1) Separately collect the scss files from the entry point index.scssAbout this config:
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: path.join(__dirname, 'src/styles/entry.scss'),
output: {
filename: 'drop-it.js', // js artifact can not escape, but the file in fact is empty
path: path.join(__dirname, 'dist')
},
module: {
rules: [{
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
}]
},
plugins: [new MiniCssExtractPlugin({
filename: 'styles.css'
})]
};
Separately collect ts files from the entry point index.tsno problem, again need to be ts-loader. Well I will say my IMHO here that transpiring better not to trust typescript, and connect Babel with the preset env
To separately place all the html files in src/html and put them in /output/this is already on zamorochki will
Find more questions by tags Webpack
- tate.Gerlach commented on April 19th 20 at 12:21