Commit 831a55e7 by 小明

调整构建生产模式的构建脚本

parent 79d1c721
......@@ -14,7 +14,7 @@
"env": {
"production": {
"only": [
"app"
"src"
],
"plugins": [
"transform-react-remove-prop-types",
......
......@@ -9,5 +9,5 @@ chai.use(chaiEnzyme());
// Include all .js files under `app`, except app.js, reducers.js, and routes.js.
// This is for code coverage
const context = require.context('../../app', true, /^^((?!(app|reducers|routes)).)*\.js$/);
const context = require.context('../../src', true, /^^((?!(app|reducers|routes)).)*\.js$/);
context.keys().forEach(context);
......@@ -14,7 +14,7 @@ module.exports = (options) => ({
module: {
loaders: [{
test: /\.js$/, // Transform all .js files required somewhere with Babel
loader: 'babel',
loader: 'babel-loader',
exclude: /node_modules/,
query: options.babelQuery,
}, {
......@@ -69,7 +69,7 @@ module.exports = (options) => ({
'.jsx',
'.react.js',
'.scss',
'.css'
'.css',
],
mainFields: [
'browser',
......
......@@ -29,7 +29,7 @@ module.exports = require('./webpack.base.babel')({
// Minify and optimize the index.html
new HtmlWebpackPlugin({
template: 'app/index.html',
template: 'src/index.html',
minify: {
removeComments: true,
collapseWhitespace: true,
......
......@@ -4,7 +4,7 @@
const webpack = require('webpack');
const modules = [
'app',
'src',
'node_modules',
];
......
......@@ -84,6 +84,7 @@
"react": "15.3.2",
"react-dom": "15.3.2",
"react-helmet": "3.1.0",
"react-intl": "2.1.5",
"react-redux": "4.4.5",
"react-router": "3.0.0",
"react-router-redux": "4.0.6",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment