Commit 831a55e7 by 小明

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

parent 79d1c721
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"env": { "env": {
"production": { "production": {
"only": [ "only": [
"app" "src"
], ],
"plugins": [ "plugins": [
"transform-react-remove-prop-types", "transform-react-remove-prop-types",
......
...@@ -9,5 +9,5 @@ chai.use(chaiEnzyme()); ...@@ -9,5 +9,5 @@ chai.use(chaiEnzyme());
// Include all .js files under `app`, except app.js, reducers.js, and routes.js. // Include all .js files under `app`, except app.js, reducers.js, and routes.js.
// This is for code coverage // 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); context.keys().forEach(context);
...@@ -14,7 +14,7 @@ module.exports = (options) => ({ ...@@ -14,7 +14,7 @@ module.exports = (options) => ({
module: { module: {
loaders: [{ loaders: [{
test: /\.js$/, // Transform all .js files required somewhere with Babel test: /\.js$/, // Transform all .js files required somewhere with Babel
loader: 'babel', loader: 'babel-loader',
exclude: /node_modules/, exclude: /node_modules/,
query: options.babelQuery, query: options.babelQuery,
}, { }, {
...@@ -69,7 +69,7 @@ module.exports = (options) => ({ ...@@ -69,7 +69,7 @@ module.exports = (options) => ({
'.jsx', '.jsx',
'.react.js', '.react.js',
'.scss', '.scss',
'.css' '.css',
], ],
mainFields: [ mainFields: [
'browser', 'browser',
......
...@@ -29,7 +29,7 @@ module.exports = require('./webpack.base.babel')({ ...@@ -29,7 +29,7 @@ module.exports = require('./webpack.base.babel')({
// Minify and optimize the index.html // Minify and optimize the index.html
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: 'app/index.html', template: 'src/index.html',
minify: { minify: {
removeComments: true, removeComments: true,
collapseWhitespace: true, collapseWhitespace: true,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
const webpack = require('webpack'); const webpack = require('webpack');
const modules = [ const modules = [
'app', 'src',
'node_modules', 'node_modules',
]; ];
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
"react": "15.3.2", "react": "15.3.2",
"react-dom": "15.3.2", "react-dom": "15.3.2",
"react-helmet": "3.1.0", "react-helmet": "3.1.0",
"react-intl": "2.1.5",
"react-redux": "4.4.5", "react-redux": "4.4.5",
"react-router": "3.0.0", "react-router": "3.0.0",
"react-router-redux": "4.0.6", "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