Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to webpack v2 #189

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions config/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
module.exports = {
cacheDirectory: true,
presets: [
'babel-preset-es2015',
'babel-preset-es2016',
'babel-preset-es2015-webpack',
'babel-preset-react'
].map(require.resolve),
plugins: [
Expand Down
3 changes: 1 addition & 2 deletions config/babel.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

module.exports = {
presets: [
'babel-preset-es2015',
'babel-preset-es2016',
'babel-preset-es2015-webpack',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, it's weird that this isn't es2015-loose. I can't think of any good reason to not use es2015-loose (and correspondingly es2015-loose-native-modules instead of either es2015-native-modules or es2015-webpack) for production.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes all the transforms run in loose mode. It's like es2015-loose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's like es2015-loose.

Haha that's what I'm asking, what is loose mode?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loose mode generates code that is simpler, but less strictly compliant to spec. Compare output:

I'm not aware of any reason to not at least run your production build in loose mode. I'm also not aware of anybody who deliberately uses non-loose mode.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's it, some people would rather be compliant to the spec even though there's more output, etc

'babel-preset-react'
].map(require.resolve),
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {
extensions: ['', '.js'],
},
resolveLoader: {
root: nodeModulesPath,
modules: nodeModulesPath,
moduleTemplates: ['*-loader']
},
module: {
Expand Down
5 changes: 3 additions & 2 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
extensions: ['', '.js'],
},
resolveLoader: {
root: nodeModulesPath,
modules: nodeModulesPath,
moduleTemplates: ['*-loader']
},
module: {
Expand All @@ -73,7 +73,7 @@ module.exports = {
// Disable autoprefixer in css-loader itself:
// https://github.com/webpack/css-loader/issues/281
// We already have it thanks to postcss.
loader: ExtractTextPlugin.extract('style', 'css?-autoprefixer!postcss')
loader: ExtractTextPlugin.extract({ fallbackLoader: 'style', loader: 'css?-autoprefixer!postcss' })
},
{
test: /\.json$/,
Expand Down Expand Up @@ -120,6 +120,7 @@ module.exports = {
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compressor: {
screw_ie8: true,
warnings: false
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"babel-plugin-transform-class-properties": "6.10.2",
"babel-plugin-transform-object-rest-spread": "6.8.0",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-preset-es2015": "6.9.0",
"babel-preset-es2015-webpack": "6.4.2",
"babel-preset-es2016": "6.11.3",
"babel-preset-react": "6.11.1",
"chalk": "1.1.3",
Expand All @@ -46,7 +46,7 @@
"eslint-plugin-import": "1.10.3",
"eslint-plugin-jsx-a11y": "2.0.1",
"eslint-plugin-react": "5.2.2",
"extract-text-webpack-plugin": "1.0.1",
"extract-text-webpack-plugin": "2.0.0-beta.3",
"file-loader": "0.9.0",
"fs-extra": "^0.30.0",
"html-webpack-plugin": "2.22.0",
Expand All @@ -56,8 +56,8 @@
"rimraf": "2.5.3",
"style-loader": "0.13.1",
"url-loader": "0.5.7",
"webpack": "1.13.1",
"webpack-dev-server": "1.14.1"
"webpack": "2.1.0-beta.20",
"webpack-dev-server": "2.1.0-beta.0"
},
"devDependencies": {
"bundle-deps": "^1.0.0",
Expand Down