-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var webpack = require('webpack'); | ||
var WebpackDevServer = require('webpack-dev-server'); | ||
var config = require('./webpack.config.development'); | ||
|
||
new WebpackDevServer(webpack(config), { | ||
publicPath: config.output.publicPath, | ||
hot: true, | ||
historyApiFallback: true, | ||
stats: { | ||
colors: true | ||
} | ||
}).listen(3000, 'localhost', function(err) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
|
||
console.log('Listening at localhost:3000'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
module: { | ||
loaders: [] | ||
}, | ||
output: { | ||
path: './dist/', | ||
filename: 'bundle.js', | ||
libraryTarget: 'commonjs2' | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'], | ||
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main'] | ||
}, | ||
plugins: [ | ||
|
||
], | ||
externals: [ | ||
// put your node 3rd party libraries which can't be built with webpack here (mysql, mongodb, and so on..) | ||
] | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* eslint strict: 0 */ | ||
'use strict'; | ||
|
||
var webpack = require('webpack'); | ||
var webpackTargetElectronRenderer = require('webpack-target-electron-renderer'); | ||
var baseConfig = require('./webpack.config.base'); | ||
|
||
|
||
var config = Object.create(baseConfig); | ||
|
||
config.debug = true; | ||
|
||
config.devtool = 'cheap-module-eval-source-map'; | ||
|
||
config.entry = [ | ||
'webpack-dev-server/client?http://localhost:3000', | ||
'webpack/hot/only-dev-server', | ||
'./app/mainApp' | ||
]; | ||
|
||
config.output.publicPath = 'http://localhost:3000/dist/'; | ||
|
||
config.module.loaders.push({ | ||
test: /\.jsx?$/, | ||
loaders: ['react-hot-loader', 'babel-loader'], | ||
exclude: /node_modules/ | ||
}, { | ||
test: /^((?!\.module).)*\.css$/, | ||
loaders: [ | ||
'style-loader', | ||
'css-loader' | ||
] | ||
}, { | ||
test: /\.module\.css$/, | ||
loaders: [ | ||
'style-loader', | ||
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!' | ||
] | ||
}); | ||
|
||
|
||
config.plugins.push( | ||
new webpack.HotModuleReplacementPlugin(), | ||
new webpack.DefinePlugin({ | ||
'__DEV__': true, | ||
'process.env': JSON.stringify('development') | ||
}) | ||
); | ||
|
||
config.target = webpackTargetElectronRenderer(config); | ||
|
||
module.exports = config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* eslint strict: 0 */ | ||
'use strict'; | ||
|
||
var webpack = require('webpack'); | ||
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
var webpackTargetElectronRenderer = require('webpack-target-electron-renderer'); | ||
var baseConfig = require('./webpack.config.base'); | ||
|
||
|
||
var config = Object.create(baseConfig); | ||
|
||
config.devtool = 'source-map'; | ||
|
||
config.entry = './app/mainApp'; | ||
|
||
config.output.publicPath = '/dist/'; | ||
|
||
var stylesTextPlugin = new ExtractTextPlugin('style.css', { allChunks: true }); | ||
var globalStylesTextPlugin = new ExtractTextPlugin('global-style.css', { allChunks: true }); | ||
|
||
config.module.loaders.push({ | ||
test: /\.jsx?$/, | ||
loaders: ['babel-loader'], | ||
exclude: /node_modules/ | ||
}, { | ||
test: /^((?!\.module).)*\.css$/, | ||
loader: globalStylesTextPlugin.extract( | ||
'style-loader', | ||
'css-loader' | ||
) | ||
}, { | ||
test: /\.module\.css$/, | ||
loader: stylesTextPlugin.extract( | ||
'style-loader', | ||
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]' | ||
) | ||
}); | ||
|
||
config.plugins.push( | ||
new webpack.optimize.OccurenceOrderPlugin(), | ||
new webpack.DefinePlugin({ | ||
'__DEV__': false, | ||
'process.env': JSON.stringify('production') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
chentsulin
Author
Member
|
||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compressor: { | ||
screw_ie8: true, | ||
warnings: false | ||
} | ||
}), | ||
stylesTextPlugin, | ||
globalStylesTextPlugin | ||
); | ||
|
||
config.target = webpackTargetElectronRenderer(config); | ||
|
||
module.exports = config; |
@chentsulin Shouldn't this be
process.env.NODE_ENV
? When I packaged the application using the latest version of package, redux devtools was getting bundled in the package.