Authored by 郭成尧

index-css-build

@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 "dev": "nodemon -e js,hbs -i public/ app.js", 12 "dev": "nodemon -e js,hbs -i public/ app.js",
13 "static": "node ./public/build/dev-server.js", 13 "static": "node ./public/build/dev-server.js",
14 "build:dll": "webpack --config ./public/build/webpack.dll.indexcss.config.js", 14 "build:dll": "webpack --config ./public/build/webpack.dll.indexcss.config.js",
15 - "build": "webpack --config ./public/build/webpack.prod.config.js --config ./public/build/webpack.dll.indexcss.config.js", 15 + "build": "webpack --config ./public/build/webpack.dll.indexcss.config.js --config ./public/build/webpack.prod.config.js",
16 "debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js", 16 "debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js",
17 "lint-js": "lint-js", 17 "lint-js": "lint-js",
18 "lint-css": "lint-css", 18 "lint-css": "lint-css",
1 const webpack = require('webpack'); 1 const webpack = require('webpack');
2 const path = require('path'); 2 const path = require('path');
  3 +const shelljs = require('shelljs');
3 const {cssLoader} = require('./utils.js'); 4 const {cssLoader} = require('./utils.js');
4 const ExtractTextPlugin = require('extract-text-webpack-plugin'); 5 const ExtractTextPlugin = require('extract-text-webpack-plugin');
  6 +const config = require('../../package.json');
  7 +const distDir = path.join(__dirname, `../dist/${config.name}/${config.version}`);
  8 +
  9 +// cope img font
  10 +shelljs.mkdir('-p', distDir);
  11 +shelljs.cp('-R', path.join(__dirname, '../font/'), distDir);
5 12
6 let webpackConfig = { 13 let webpackConfig = {
7 entry: { 14 entry: {