I am trying to compile sass/scss
to css for production.
Essentially I was wondering how can you create a file structure for your assets in prod and get the scss files to get complied to css in prod? I have seen in many TUTs, everything gets dumped in a dist
or public folder
. I can do it for JS, but how would you do it for all my assets? Example in the public folder there is a JS folder a image folder, css
etc.
This is my webpack.config.js
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
app: ['./src/js/app.js']
},
output: {
path: path.resolve(__dirname, 'public/js'),
filename: 'app.bundle.js',
publicPath: 'js'
},
devServer: {
inline: true,
contentBase: './public',
port: 8888
},
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use : 'css-loader!sass-loader'
})
}
]
},
plugins: [
new ExtractTextPlugin('styles.css')
]
}