Skip to content

Commit

Permalink
Update to Webpack 2.0 to workaround the bug with require
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup committed Feb 7, 2017
1 parent f7c7378 commit e9a63a3
Show file tree
Hide file tree
Showing 3 changed files with 1,108 additions and 961 deletions.
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,31 @@
]
},
"devDependencies": {
"babel-cli": "^6.11.4",
"babel-core": "^6.13.2",
"babel-eslint": "^6.1.2",
"babel-jest": "^15.0.0",
"babel-loader": "^6.2.4",
"babel-cli": "^6.22.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-jest": "^18.0.0",
"babel-loader": "^6.2.10",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "^6.5.0",
"cross-env": "^2.0.0",
"eslint": "^3.2.2",
"eslint-loader": "^1.5.0",
"eslint-plugin-react": "^6.4.1",
"gh-pages": "^0.11.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"cross-env": "^3.1.4",
"eslint": "^3.15.0",
"eslint-loader": "^1.6.1",
"eslint-plugin-react": "^6.9.0",
"gh-pages": "^0.12.0",
"jest-cli": "^18.0.0",
"react": "^15.3.0",
"react-redux": "^4.4.5",
"react-test-renderer": "^15.3.1",
"react": "^15.4.2",
"react-redux": "^5.0.2",
"react-test-renderer": "^15.4.2",
"redux": "^3.5.2",
"rimraf": "^2.5.4",
"rx": "^4.1.0",
"rxjs": "^5.0.3",
"webpack": "^1.13.1",
"yargs": "^4.8.1"
"rxjs": "^5.1.0",
"webpack": "^2.2.1",
"yargs": "^6.6.0"
},
"peerDependencies": {
"react": "^15.3.0",
Expand Down
40 changes: 10 additions & 30 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
var webpack = require("webpack");
var path = require("path");

var env = process.env.NODE_ENV

var reactExternal = {
root: 'React',
commonjs2: 'react',
Expand Down Expand Up @@ -35,43 +32,26 @@ var config = {
libraryTarget: "umd"
},
module: {
loaders: [
rules: [
{
test: /\.js$/,
loader: "babel",
exclude: /(node_modules)/
loader: "babel-loader",
exclude: path.join(__dirname, "node_modules")
},
{
test: /\.js$/,
loader: "eslint-loader",
exclude: /node_modules/
exclude: path.join(__dirname, "node_modules")
}
]
},
resolve: {
root: path.resolve("./src"),
extensions: ["", ".js"]
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(env)
})
]
modules: [
path.resolve(__dirname, "src"),
path.resolve(__dirname, "node_modules"),
],
extensions: [".js"]
}
};

if (env === "production") {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
screw_ie8: true,
warnings: false
}
})
)
}

module.exports = config;
Loading

0 comments on commit e9a63a3

Please sign in to comment.