Skip to content

Instantly share code, notes, and snippets.

@lukencode
Created May 14, 2018 12:16
Show Gist options
  • Save lukencode/a48ca54cedc442f6dd36fd72460f3a10 to your computer and use it in GitHub Desktop.
Save lukencode/a48ca54cedc442f6dd36fd72460f3a10 to your computer and use it in GitHub Desktop.
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const outputDir = './wwwroot/dist'
const entry = './wwwroot/js/app.js'
const cssOutput = 'site.css'
module.exports = (env) => {
return [{
entry: entry,
output: {
path: path.join(__dirname, outputDir),
filename: '[name].js',
publicPath: '/dist/'
},
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader'
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: ['css-loader'],
fallback: 'style-loader'
})
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: ['css-loader', 'sass-loader' ],
fallback: 'style-loader'
})
}
]
},
plugins: [
new ExtractTextPlugin(cssOutput)
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment