UNPKG

generator-ng2-pro

Version:

A yeoman generator to scaffold an Angular2 application

60 lines (58 loc) 1.76 kB
var webpack = require('webpack'); var webpackMerge = require('webpack-merge'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var commonConfig = require('./webpack.common.js'); var helpers = require('./helpers'); var CopyWebpackPlugin = require('copy-webpack-plugin'); var path = require('path'); module.exports = webpackMerge(commonConfig, { devtool: 'source-map', output: { path: helpers.root('dist'), publicPath: './', filename: '[name].[hash].js', chunkFilename: '[id].[hash].chunk.js' }, module: { rules: [ /* * Extract CSS files from .src/styles directory to external CSS file */ { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', loader: 'css-loader' }), include: [helpers.root('src', 'assets')] }, /* * Extract and compile SCSS files from .src/styles directory to external CSS file */ { test: /\.scss$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', loader: ['css-loader', 'sass-loader?includePaths[]=' + path.resolve(__dirname, "../node_modules/compass-mixins/lib")] }), include: [helpers.root('src', 'assets')] }, ] }, plugins: [ new webpack.NoEmitOnErrorsPlugin(), new ExtractTextPlugin({ // define where to save the file filename: '[name].bundle.css', allChunks: true, }), new CopyWebpackPlugin([{ from: 'src/assets/images', to: 'assets/images' }]), new webpack.LoaderOptionsPlugin({ htmlLoader: { minimize: false // workaround for ng2 } }) ] });