@@ -2,48 +2,50 @@ const path = require('path')
22const webpack = require ( 'webpack' )
33const LodashModuleReplacementPlugin = require ( 'lodash-webpack-plugin' )
44const CleanWebpackPlugin = require ( 'clean-webpack-plugin' )
5+ const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' )
56const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin
67
78module . exports = {
89 entry : [ './src/main.js' ] ,
910 output : {
1011 path : path . resolve ( __dirname , './dist' ) ,
11- publicPath : '/dist/ ' ,
12- filename : 'markdown-palettes.js '
12+ filename : 'markdown-palettes.js ' ,
13+ publicPath : './ '
1314 } ,
1415 plugins : [
1516 new LodashModuleReplacementPlugin ( ) ,
1617 new webpack . optimize . OccurrenceOrderPlugin ( ) ,
18+ new ExtractTextPlugin ( 'markdown-palettes.css' ) ,
1719 new CleanWebpackPlugin ( [ 'dist' ] )
1820 ] ,
1921 module : {
2022 rules : [
21- {
22- test : / \. c s s $ / ,
23- use : [
24- 'vue-style-loader' ,
25- 'css-loader'
26- ] ,
27- } ,
2823 {
2924 test : / \. v u e $ / ,
3025 loader : 'vue-loader' ,
3126 options : {
3227 loaders : {
33- }
34- // other vue-loader options go here
28+ } ,
29+ extractCSS : true
3530 }
3631 } ,
3732 {
3833 test : / \. j s $ / ,
3934 loader : 'babel-loader' ,
4035 exclude : / n o d e _ m o d u l e s /
4136 } ,
37+ {
38+ test : / \. c s s $ / ,
39+ use : ExtractTextPlugin . extract ( {
40+ use : 'css-loader' ,
41+ fallback : 'vue-style-loader'
42+ } )
43+ } ,
4244 {
4345 test : / \. ( p n g | j p g | g i f | s v g | t t f | e o t | w o f f | w o f f 2 ) $ / ,
4446 loader : 'url-loader' ,
4547 options : {
46- limit : 5000 ,
48+ limit : 8192 ,
4749 name : '[name].[ext]?[hash]'
4850 }
4951 }
@@ -58,7 +60,8 @@ module.exports = {
5860 devServer : {
5961 historyApiFallback : true ,
6062 noInfo : true ,
61- overlay : true
63+ overlay : true ,
64+ publicPath : '/dist/'
6265 } ,
6366 performance : {
6467 hints : false
0 commit comments