Created
May 14, 2018 12:16
-
-
Save lukencode/a48ca54cedc442f6dd36fd72460f3a10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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