const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [{
test: /\.s[ac]ss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
url: false
}
},
"sass-loader",
],
}, ],
},
plugins: [
new MiniCssExtractPlugin()
],
resolve: {
extensions: ['.js', '.scss']
}
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel='stylesheet' href='dist/main.css'>
</head>
<body>
<script src="dist/bundle.js"></script>
</body>
</html>