Skip to content

Instantly share code, notes, and snippets.

@alihesari
Created January 18, 2018 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alihesari/186b03bd8d79857870dc3afc8f537adf to your computer and use it in GitHub Desktop.
Save alihesari/186b03bd8d79857870dc3afc8f537adf to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/js/main.js',
output: {
path: path.resolve(__dirname, 'dist/'),
publicPath: 'dist/',
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
// minimize: true
}
},
{
loader: 'sass-loader'
},
]
})
},
{
test: /\.(png|jpg|jpeg|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader',
query: {
limit: 10000,
name: '[name].[ext]'
}
}
]
},
plugins: [
new ExtractTextPlugin('[name].css', { allChunks: true }),
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment