Skip to content
Permalink
Browse files

update:Exclude css file

  • Loading branch information...
hiyangguo committed Apr 20, 2018
1 parent 1509f94 commit 90c1f24af526cd6d48bf6b095500e4ffa5c7f0e6
Showing with 9 additions and 9 deletions.
  1. +1 −1 package.json
  2. +0 −3 src/index.js
  3. +3 −0 src/themes.js
  4. +5 −5 webpack.config.js
@@ -6,7 +6,7 @@
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --mode development --progress --hot",
"build": "rm -rf dist && NODE_ENV=production webpack --mode production --progress && cp -R public/* ./dist/ "
"build": "rm -rf dist && NODE_ENV=production webpack --mode production --progress && cp -R public/* ./dist/ && rm -rf dist/themes.bundle.js"
},
"author": "Godfery <hiyangguo@qq.com>",
"license": "MIT",
@@ -3,9 +3,6 @@ import ReactDOM from 'react-dom';

// style
import './less/index.less';
import './less/themes/green.less';
import './less/themes/red.less';
import './less/themes/yellow.less';

import App from './App';

@@ -0,0 +1,3 @@
import './less/themes/green.less';
import './less/themes/red.less';
import './less/themes/yellow.less';
@@ -4,7 +4,6 @@ const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlwebpackPlugin = require('html-webpack-plugin');

const { STYLE_DEBUG } = process.env;
// 主题路径
const THEME_PATH = './src/less/themes';

@@ -41,7 +40,8 @@ module.exports = {
port: 3201
},
entry: {
app: './src/index.js'
app: './src/index.js',
themes: './src/themes.js'
},
output: {
filename: '[name].bundle.js?[hash]',
@@ -87,8 +87,8 @@ module.exports = {
new HtmlwebpackPlugin({
title: 'webpack 多主题打包演示',
template: 'src/index.html',
inject: true
inject: true,
excludeChunks: ['themes']
})
],
devtool: STYLE_DEBUG === 'SOURCE' && 'source-map'
]
};

0 comments on commit 90c1f24

Please sign in to comment.
You can’t perform that action at this time.