Skip to content

Instantly share code, notes, and snippets.

@mycolaos
Last active March 2, 2023 15:07
Show Gist options
  • Save mycolaos/7c631138e34ca33efef654ba60fa0ec2 to your computer and use it in GitHub Desktop.
Save mycolaos/7c631138e34ca33efef654ba60fa0ec2 to your computer and use it in GitHub Desktop.
const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: ["css-loader", "postcss-loader", "sass-loader"]
})
}
]
},
plugins: [
new ExtractTextPlugin("styles.css")
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment