Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade stack I wanted to upgrade only babel but everything else was broken so I upgraded babel, webpack, eslint and karma. Disabled a lot of eslint rules to not change existing code. Maybe it's better to migrate to prettier later. This changes will unblock me from providing smaller output. * Fix flow
- Loading branch information
Showing
11 changed files
with
8,139 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"stage": 0, | ||
"loose": "all", | ||
"env": { | ||
"production": { | ||
"optional": [ | ||
"optimisation.react.inlineElements", | ||
"optimisation.react.constantElements" | ||
] | ||
} | ||
} | ||
"presets": [ | ||
"@babel/env", | ||
"@babel/stage-3", | ||
"@babel/flow", | ||
"@babel/react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,43 @@ | ||
'use strict'; | ||
|
||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
// Temporary fix for css-loader/post-css | ||
// 'Module build failed: ReferenceError: Promise is not defined' | ||
require('babel/polyfill'); | ||
|
||
var webpack = require('webpack'); | ||
var path = require('path'); | ||
|
||
var loaders = ['babel']; | ||
var port = process.env.PORT || 3000; | ||
|
||
var devtool; | ||
var plugins = [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
}) | ||
]; | ||
var entry = { | ||
'demo0-simple-transition': './demos/demo0-simple-transition/index.jsx', | ||
'demo1-chat-heads': './demos/demo1-chat-heads/index.jsx', | ||
'demo2-draggable-balls': './demos/demo2-draggable-balls/index.jsx', | ||
'demo3-todomvc-list-transition': './demos/demo3-todomvc-list-transition/index.jsx', | ||
'demo4-photo-gallery': './demos/demo4-photo-gallery/index.jsx', | ||
'demo5-spring-parameters-chooser': './demos/demo5-spring-parameters-chooser/index.jsx', | ||
'demo7-water-ripples': './demos/demo7-water-ripples/index.jsx', | ||
'demo8-draggable-list': './demos/demo8-draggable-list/index.jsx', | ||
}; | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
devtool ='eval-source-map'; | ||
loaders = ['react-hot'].concat(loaders); | ||
plugins = plugins.concat([ | ||
new webpack.HotModuleReplacementPlugin() | ||
]); | ||
entry = Object.keys(entry).reduce(function (result, key) { | ||
result[key] = [ | ||
'webpack-dev-server/client?http://0.0.0.0:' + port, | ||
'webpack/hot/only-dev-server', | ||
entry[key] | ||
]; | ||
return result; | ||
}, {}); | ||
} else { | ||
devtool ='source-map'; | ||
plugins = plugins.concat([ | ||
new webpack.optimize.OccurenceOrderPlugin() | ||
]); | ||
} | ||
|
||
module.exports = { | ||
devtool: devtool, | ||
entry: entry, | ||
mode: "development", | ||
devtool: | ||
process.env.NODE_ENV === 'development' ? 'eval-source-map' : 'source-map', | ||
entry: { | ||
'demo0-simple-transition': './demos/demo0-simple-transition/index.jsx', | ||
'demo1-chat-heads': './demos/demo1-chat-heads/index.jsx', | ||
'demo2-draggable-balls': './demos/demo2-draggable-balls/index.jsx', | ||
'demo3-todomvc-list-transition': './demos/demo3-todomvc-list-transition/index.jsx', | ||
'demo4-photo-gallery': './demos/demo4-photo-gallery/index.jsx', | ||
'demo5-spring-parameters-chooser': './demos/demo5-spring-parameters-chooser/index.jsx', | ||
'demo7-water-ripples': './demos/demo7-water-ripples/index.jsx', | ||
'demo8-draggable-list': './demos/demo8-draggable-list/index.jsx', | ||
}, | ||
output: { | ||
filename: '[name]/all.js', | ||
publicPath: '/demos/', | ||
path: __dirname + '/demos/', | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.jsx?$/, | ||
exclude: /build|lib|bower_components|node_modules/, | ||
loaders: loaders | ||
}, { | ||
test: /\.css$/, | ||
loaders: ['style', 'css'] | ||
}], | ||
preLoaders: [ | ||
{test: /\.jsx?$/, loader: 'eslint', exclude: /build|lib|bower_components|node_modules/}, | ||
], | ||
noParse: [ | ||
path.join(__dirname, 'node_modules', 'babel-core', 'browser.min.js') | ||
rules: [ | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: /build|lib|bower_components|node_modules/, | ||
loader: 'babel-loader' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ['style-loader', 'css-loader'] | ||
}, | ||
{ | ||
test: /\.jsx?$/, | ||
loader: 'eslint-loader', | ||
exclude: /build|lib|bower_components|node_modules/ | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'] | ||
extensions: ['.js', '.jsx'] | ||
}, | ||
plugins: plugins, | ||
eslint: {configFile: '.eslintrc'}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.