-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade webpack to 2 & react to 15.5.0 & use html5 history
- Loading branch information
Showing
44 changed files
with
2,311 additions
and
2,105 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,19 +1,13 @@ | ||
{ | ||
"presets": [ | ||
"es2015", | ||
["es2015", { "modules": false }], | ||
"react", | ||
"stage-0" | ||
], | ||
"plugins": [ | ||
"transform-async-to-generator", | ||
"transform-decorators-legacy", | ||
"transform-object-assign" | ||
], | ||
"env": { | ||
"dist": { | ||
"plugins": [ | ||
"transform-react-remove-prop-types" | ||
] | ||
} | ||
} | ||
"transform-object-assign", | ||
"react-hot-loader/babel" | ||
] | ||
} |
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,54 +1,51 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const BowerWebpackPlugin = require('bower-webpack-plugin'); | ||
|
||
const srcPath = path.join(__dirname, '/../src'); | ||
|
||
module.exports = { | ||
output: { | ||
path: path.join(__dirname, '/../dist/assets'), | ||
filename: 'bundle.js', | ||
publicPath: '/assets/' | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'], | ||
alias: { | ||
actions: `${srcPath}/actions/`, | ||
components: `${srcPath}/components/`, | ||
containers: `${srcPath}/containers/`, | ||
reducers: `${srcPath}/reducers/`, | ||
sources: `${srcPath}/sources/`, | ||
stores: `${srcPath}/stores/`, | ||
styles: `${srcPath}/styles/`, | ||
config: `${srcPath}/config/base`, | ||
'react/lib/ReactMount': 'react-dom/lib/ReactMount' | ||
} | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.css$/, | ||
loader: 'style-loader!css-loader?outputStyle=expanded' | ||
}, { | ||
test: /\.sass/, | ||
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded&indentedSyntax' | ||
}, { | ||
test: /\.scss/, | ||
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded' | ||
}, { | ||
test: /\.(png|jpg|gif|woff|woff2|ttf|svg|eot)(\?|\?[a-z0-9]+)?$/, | ||
loader: 'url-loader?limit=8192' | ||
}, { | ||
test: /\.(mp4|ogg)$/, | ||
loader: 'file-loader' | ||
}, { | ||
test: /masonry|imagesloaded|fizzy\-ui\-utils|desandro\-|outlayer|get\-size|doc\-ready|eventie|eventemitter/, | ||
loader: 'imports?define=>false&this=>window' | ||
}] | ||
}, | ||
plugins: [ | ||
new webpack.NoErrorsPlugin(), | ||
new BowerWebpackPlugin({ | ||
searchResolveModulesDirectories: false | ||
}) | ||
] | ||
output: { | ||
path: path.join(__dirname, '/../dist/assets'), | ||
filename: 'bundle.js', | ||
publicPath: '/assets/' | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.jsx'], | ||
alias: { | ||
'@': path.join(__dirname, '/../src') | ||
} | ||
}, | ||
module: { | ||
rules: [{ | ||
test: /\.(js|jsx)$/, | ||
enforce: 'pre', | ||
include: path.join(__dirname, '/../src'), | ||
loader: 'eslint-loader' | ||
}, { | ||
test: /\.css$/, | ||
loader: 'style-loader!css-loader?outputStyle=expanded' | ||
}, { | ||
test: /\.sass/, | ||
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded&indentedSyntax' | ||
}, { | ||
test: /\.scss/, | ||
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded' | ||
}, { | ||
test: /\.(js|jsx)$/, | ||
loader: 'babel-loader', | ||
include: [].concat([path.join(__dirname, '/../src')]) | ||
}, { | ||
test: /\.(png|jpg|gif|woff|woff2|ttf|svg|eot)(\?|\?[a-z0-9]+)?$/, | ||
loader: 'url-loader?limit=8192' | ||
}, { | ||
test: /\.(mp4|ogg)$/, | ||
loader: 'file-loader' | ||
}, { | ||
test: /masonry|imagesloaded|fizzy\-ui\-utils|desandro\-|outlayer|get\-size|doc\-ready|eventie|eventemitter/, | ||
loader: 'imports-loader?define=>false&this=>window' | ||
}] | ||
}, | ||
plugins: [ | ||
new webpack.NoEmitOnErrorsPlugin() | ||
] | ||
}; |
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,49 +1,34 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const OpenBrowserPlugin = require('open-browser-webpack-plugin'); | ||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin'); | ||
|
||
module.exports = { | ||
devServer: { | ||
contentBase: './src/', | ||
historyApiFallback: true, | ||
inline: true, | ||
port: 23333, | ||
publicPath: '/assets/', | ||
noInfo: false, | ||
stats: { | ||
colors: true | ||
}, | ||
quiet: true | ||
}, | ||
entry: [ | ||
'babel-polyfill', | ||
'webpack-dev-server/client?http://127.0.0.1:23333', | ||
'webpack/hot/only-dev-server', | ||
'es6-promise', | ||
'whatwg-fetch', | ||
'./src/index' | ||
], | ||
cache: true, | ||
devtool: 'eval', | ||
module: { | ||
preLoaders: [{ | ||
test: /\.(js|jsx)$/, | ||
include: path.join(__dirname, '/../src'), | ||
loader: 'eslint-loader' | ||
}], | ||
loaders: [{ | ||
test: /\.(js|jsx)$/, | ||
loader: 'react-hot!babel-loader', | ||
include: [].concat([path.join(__dirname, '/../src')]) | ||
}] | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': '"development"' | ||
}), | ||
new webpack.NoErrorsPlugin(), | ||
new FriendlyErrorsPlugin(), | ||
new OpenBrowserPlugin({ url: 'http://localhost:23333' }) | ||
] | ||
devServer: { | ||
contentBase: './src/', | ||
historyApiFallback: true, | ||
inline: true, | ||
port: 23333, | ||
publicPath: '/assets/', | ||
noInfo: false, | ||
stats: { | ||
colors: true | ||
} | ||
}, | ||
entry: [ | ||
'babel-polyfill', | ||
'react-hot-loader/patch', | ||
'webpack-dev-server/client?http://127.0.0.1:23333', | ||
'webpack/hot/only-dev-server', | ||
'whatwg-fetch', | ||
'./src/index' | ||
], | ||
cache: true, | ||
devtool: 'eval', | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': '"development"' | ||
}), | ||
new OpenBrowserPlugin({ url: 'http://localhost:23333' }), | ||
new webpack.HotModuleReplacementPlugin() | ||
] | ||
}; |
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
Oops, something went wrong.