Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanco committed Nov 4, 2017
1 parent 299bca7 commit 13daeca
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 22 deletions.
1 change: 0 additions & 1 deletion dist/app.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/app.js

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@
"scripts": {
"build": "webpack"
},
"dependencies": {

"devDependencies": {
"css-loader": "^0.28.7",
"extract-text-webpack-plugin": "^3.0.2",
"fs": "^0.0.1-security",
"glob": "^7.1.2",
"iconfont-webpack-plugin": "^1.1.0",
"install": "^0.10.1",
"lodash": "^4.17.4",
"npm": "^5.5.1",
"path": "^0.12.7",
"postcss-loader": "^2.0.8",
"style-loader": "^0.19.0",
"uglifyjs-webpack-plugin": "^1.0.0-beta.3",
"webpack": "^3.7.1",
"webpack-css-concat-plugin": "^0.0.0",
"webpack-merge": "^4.1.0"
}
}
}
3 changes: 2 additions & 1 deletion script/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
console.log('ftw');
console.log('ftw');
alert('11')
29 changes: 20 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
var webpack = require('webpack');
var path = require('path');
// plugin
var UglifyJSPlugin = require('uglifyjs-webpack-plugin')
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var IconfontWebpackPlugin = require('iconfont-webpack-plugin');

var glob = require("glob");
// distribute folder
var BUILD_DIR = path.resolve(__dirname, 'dist');
var jsFileList = glob.sync("./script/*.js");
var cssFileList = glob.sync("./css/*.css");
cssFileList.forEach(function (element) {
jsFileList.push(element);
});

var config = {
entry: glob.sync("./script/*.js"),
entry: glob.sync("./css/*.css"),
entry: jsFileList,
output: {
path: BUILD_DIR,
filename: 'app.js'
},
watch: true,
// watch: true,
plugins: [
new UglifyJSPlugin({
exclude: /\/excludes/
Expand All @@ -23,21 +31,24 @@ var config = {
rules: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader',
{
loader: 'css-loader',
loader: 'postcss-loader',
options: {
sourceMap: false,
minimize: true
plugins: (loader) => [
new IconfontWebpackPlugin(loader)
]
}
}
]
})

}
]
},
}
,
};

module.exports = config;
Loading

0 comments on commit 13daeca

Please sign in to comment.