mirror of
https://github.com/wassname/generator-react-webpack.git
synced 2026-09-12 12:21:11 +08:00
Move webpack configs to tempates
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Webpack development server configuration
|
||||
*
|
||||
* This file is set up for serving the webpak-dev-server, which will watch for changes and recompile as required if
|
||||
* the subfolder /webpack-dev-server/ is visited. Visiting the root will not automatically reload.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
var webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
|
||||
output: {
|
||||
filename: 'main.js',
|
||||
publicPath: '/assets/'
|
||||
},
|
||||
|
||||
cache: true,
|
||||
debug: true,
|
||||
devtool: false,
|
||||
entry: [
|
||||
'webpack/hot/only-dev-server',
|
||||
'./src/scripts/components/<%= pkg.mainInput %>.jsx'
|
||||
],
|
||||
|
||||
stats: {
|
||||
colors: true,
|
||||
reasons: true
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: ['', '.js', '.jsx']
|
||||
},
|
||||
|
||||
module: {
|
||||
preLoaders: [{
|
||||
test: '\\.js$',
|
||||
exclude: 'node_modules',
|
||||
loader: 'jshint'
|
||||
}],
|
||||
loaders: [{
|
||||
test: /\.jsx$/,
|
||||
loader: 'react-hot!jsx-loader?harmony'
|
||||
}, {
|
||||
test: /\.css$/,
|
||||
loader: 'style-loader!css-loader'
|
||||
}, {
|
||||
test: /\.(png|jpg)$/,
|
||||
loader: 'url-loader?limit=8192'
|
||||
}]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoErrorsPlugin()
|
||||
]
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user