Skip to content

Commit

Permalink
added babel plugins/polyfills to allow for usage in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Schonfeld authored and aschonfeld committed Sep 24, 2019
1 parent 6ef58b4 commit 4edd94d
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 189 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"devDependencies": {
"@babel/core": "7.6.0",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-transform-classes": "7.5.5",
"@babel/preset-env": "7.6.0",
"@babel/preset-flow": "7.0.0",
"@babel/preset-react": "7.0.0",
Expand Down Expand Up @@ -106,6 +107,7 @@
"dependencies": {
"@fortawesome/fontawesome-free": "5.10.2",
"any-promise": "1.3.0",
"babel-polyfill": "6.26.0",
"bootstrap": "4.3.1",
"chart.js": "2.8.0",
"chartjs-plugin-zoom": "0.7.3",
Expand Down
1 change: 1 addition & 0 deletions static/polyfills.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("babel-polyfill");
require("es6-object-assign").polyfill();
require("es6-promise").polyfill();

Expand Down
12 changes: 11 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,22 @@ function createConfig(entry) {
test: /.jsx?$/,
loader: "babel-loader",
exclude(file) {
// popsicle's code is not IE compliant so we need to run it through the babel plugins
if (file.startsWith(__dirname + "/node_modules/@servie")) {
return false;
}
if (file.startsWith(__dirname + "/node_modules/servie")) {
return false;
}
if (file.startsWith(__dirname + "/node_modules/popsicle")) {
return false;
}
return file.startsWith(__dirname + "/node_modules");
},
query: {
cacheDirectory: true,
presets: ["@babel/env", "@babel/react", "@babel/flow"],
plugins: ["@babel/plugin-proposal-class-properties"],
plugins: ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-classes"],
},
},
{
Expand Down
Loading

0 comments on commit 4edd94d

Please sign in to comment.