|
|
@@ -1,7 +1,7 @@ |
|
|
|
var webpack = require('webpack'); |
|
|
|
var path = require('path'); |
|
|
|
var ExtractTextPlugin = require('extract-text-webpack-plugin'); |
|
|
|
var UnminifiedWebpackPlugin = require('unminified-webpack-plugin'); |
|
|
|
var purify = require("purifycss-webpack-plugin"); |
|
|
|
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); |
|
|
|
|
|
|
|
module.exports = { |
|
|
@@ -22,14 +22,7 @@ module.exports = { |
|
|
|
{test: /\.js$/, include: [path.resolve(__dirname, './src')], loader: 'babel-loader'}, |
|
|
|
{test: /\.json/, loader: 'json-loader'}, |
|
|
|
{test: /\.(png|jpg|jpeg|gif)$/, loader: 'file-loader?name=[name].[ext]'}, |
|
|
|
{ |
|
|
|
test: /\.css$/, |
|
|
|
loader: ExtractTextPlugin.extract({ |
|
|
|
fallbackLoader: 'style-loader', |
|
|
|
loader: 'css-loader', |
|
|
|
publicPath: '' |
|
|
|
}) |
|
|
|
}, |
|
|
|
{test: /\.scss$/, loader: ExtractTextPlugin.extract({fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader', publicPath: ''})}, |
|
|
|
{test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'}, |
|
|
|
{test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'}, |
|
|
|
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/octet-stream'}, |
|
|
@@ -38,7 +31,14 @@ module.exports = { |
|
|
|
] |
|
|
|
}, |
|
|
|
plugins: [ |
|
|
|
new ExtractTextPlugin('lesspass.min.css') |
|
|
|
new ExtractTextPlugin('lesspass.min.css'), |
|
|
|
new purify({ |
|
|
|
basePath: __dirname, |
|
|
|
paths: [ |
|
|
|
"src/**/*.html", |
|
|
|
"src/**/*.vue" |
|
|
|
] |
|
|
|
}) |
|
|
|
], |
|
|
|
devtool: '#eval-source-map' |
|
|
|
}; |
|
|
@@ -47,14 +47,11 @@ if (process.env.NODE_ENV === 'production') { |
|
|
|
module.exports.devtool = false; |
|
|
|
module.exports.plugins = (module.exports.plugins || []).concat([ |
|
|
|
new OptimizeCssAssetsPlugin(), |
|
|
|
new webpack.optimize.DedupePlugin(), |
|
|
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), |
|
|
|
new webpack.optimize.UglifyJsPlugin({ |
|
|
|
compress: { |
|
|
|
warnings: false |
|
|
|
} |
|
|
|
}), |
|
|
|
new UnminifiedWebpackPlugin() |
|
|
|
}) |
|
|
|
]); |
|
|
|
} |
|
|
|
|