Browse Source

chore: update config for SPA

pull/1093/head
Benjy Cui 9 years ago
parent
commit
ab6f3d302c
  1. 5
      package.json
  2. 22
      webpack.deploy.config.js
  3. 6
      webpack.website.config.js

5
package.json

@ -71,6 +71,7 @@
"warning": "~2.1.0"
},
"devDependencies": {
"atool-build": "^0.5.0",
"babel-cli": "^6.2.0",
"babel-core": "^6.2.1",
"babel-jest": "^6.0.1",
@ -84,6 +85,8 @@
"chalk": "^1.1.0",
"css-loader": "^0.23.0",
"cz-conventional-changelog": "^1.1.5",
"dora": "^0.2.3",
"dora-plugin-atool-build": "^0.4.1",
"es3ify-loader": "^0.1.0",
"eslint": "^2.2.0",
"eslint-config-airbnb": "^6.0.1",
@ -124,7 +127,7 @@
},
"scripts": {
"babel": "babel components index.js --out-dir lib",
"start": "npm run clean && nico server --watch",
"start": "dora -p 8001 --plugins atool-build?config=webpack.website.config.js",
"clean": "rm -rf _site dist",
"site": "npm run clean && webpack --config webpack.deploy.config.js && webpack --config webpack.antd.config.js && NODE_ENV=PRODUCTION nico build",
"deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy",

22
webpack.deploy.config.js

@ -1,22 +0,0 @@
var webpack = require('webpack');
var config = require('./webpack.config');
delete config.devtool;
config.entry.demo = [config.entry.demo[0]];
config.plugins = [config.plugins[0], new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
output: {
ascii_only: true
}
})];
config.module.loaders.forEach(function(loader) {
if (loader.loader === 'babel') {
// remove preset hmre
loader.query.presets = loader.query.presets.slice(0, 3);
}
return loader;
});
module.exports = config;

6
webpack.website.config.js

@ -0,0 +1,6 @@
module.exports = function(webpackConfig) {
webpackConfig.entry = {
index: './site/entry/index.jsx',
};
return webpackConfig;
};
Loading…
Cancel
Save