Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;(function() {
- 'use strict';
- console.log('Webpack config');
- const webpack = require('webpack');
- const path = require('path');
- const autoprefixer = require('autoprefixer');
- const APP = __dirname + '/app';
- module.exports = {
- context: APP,
- entry: {
- app: ['webpack/hot/dev-server', './core/bootstrap.js',],
- },
- output: {
- path: APP,
- filename: 'bundle.js',
- },
- module: {
- loaders: [
- {
- test: /\.html$/,
- loader: 'raw',
- },
- {
- test: /\.(jpe?g|png|gif|svg)$/i,
- loaders: [
- 'file?hash=sha512&digest=hex&name=img/[path][hash].[ext]',
- 'image-webpack',
- ],
- },
- {
- test: /\.scss$/,
- loader: 'style!css!postcss!sass!sass-resources!scsslint',
- },
- {
- test: /\.js$/,
- loader: 'ng-annotate!babel!eslint',
- exclude: /node_modules/,
- },
- ],
- },
- postcss() {
- return [autoprefixer,];
- },
- // The following config parameter allows us to import all the .scss files from our
- // components without having to manually import them in main.scss
- sassResources: path.resolve(__dirname, './app/components/**/*.scss'),
- imageWebpackLoader: {
- pngquant: {
- quality: "65-90",
- speed: 4,
- },
- svgo: {
- plugins: [
- {
- removeViewBox: false,
- },
- {
- removeEmptyAttrs: false,
- },
- ],
- },
- },
- plugins: [
- new webpack.optimize.UglifyJsPlugin({
- minimize: true,
- output: {
- comments: false,
- },
- compressor: {
- warnings: false,
- },
- }),
- ],
- };
- }());
Advertisement
Add Comment
Please, Sign In to add comment