Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. const path = require('path');
  3. const webpack = require('webpack');
  4. const HtmlWebpackPlugin = require('html-webpack-plugin');
  5.  
  6. module.exports = {
  7.     context: path.resolve('src'),
  8.     output: {
  9.         path: path.resolve('public'),
  10.         publicPath: '/',
  11.         filename: '[name].bundle.js',
  12.         chunkFilename: '[name].[id].js'
  13.     },
  14.     resolve: {
  15.         root: path.resolve('src'),
  16.         modulesDirectories: [
  17.             'node_modules'
  18.         ]
  19.     },
  20.     module: {
  21.         loaders: [
  22.             {
  23.                 test: /\.pug$/,
  24.                 loader: 'pug',
  25.                 query: { pretty: true }
  26.             }, {
  27.                 test: /\.css$/,
  28.                 loader: 'style!css?-minifySelectors'
  29.             }, {
  30.                 test: /\.styl$/,
  31.                 loader: 'style!css?camelCase&-minifySelectors&localIdentName=[local]___[hash:base64:5]!stylus?resolve url'
  32.             }
  33.         ],
  34.     },
  35.     plugins: [
  36.         new webpack.NoErrorsPlugin(),
  37.  
  38.         new HtmlWebpackPlugin({
  39.             template: 'pug/main.pug',
  40.             filename: 'main.html',
  41.             inject: false
  42.         })
  43.     ],
  44.     entry: {
  45.         main: 'js/main.js',
  46.     }
  47. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement