github.com/rabbouni145/gg@v0.47.1/docs/themes/gohugoioTheme/src/webpack.config.js (about) 1 var path = require("path"); 2 var ExtractTextPlugin = require("extract-text-webpack-plugin"); 3 var webpack = require("webpack"); 4 module.exports = { 5 entry: { 6 app: './js/main.js' 7 }, 8 module: { 9 rules: [ 10 { 11 test: /\.js$/, 12 exclude: /node_modules/, 13 use: { 14 loader: 'babel-loader', 15 options: { 16 presets: ['env'] 17 // plugins: [require('babel-plugin-transform-object-rest-spread')] 18 } 19 } 20 }, 21 { 22 test: /\.css$/, 23 use: ExtractTextPlugin.extract({ 24 fallback: "style-loader", 25 use: 'css-loader?importLoaders=1!postcss-loader' 26 }) 27 } 28 ] 29 }, 30 31 output: { 32 path: path.join(__dirname, "./../static/dist"), 33 filename: '[name].bundle.js', 34 }, 35 36 resolve: { 37 modules: [path.resolve(__dirname, 'src'), 'node_modules'], 38 }, 39 40 plugins: [ 41 new ExtractTextPlugin("main.css"), 42 new webpack.ProvidePlugin({ 43 $: "jquery", 44 jQuery: "jquery" 45 }) 46 ], 47 watchOptions: { 48 watch: true 49 } 50 }