Files
frontend-bootcamp/webpack.config.js
Micah Godbolt 6d1f93c441 hacking fool!
2019-02-08 15:20:11 -08:00

42 lines
952 B
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const entries = {
step01: './step01/index',
step02: './step02/index',
playground: './playground/src/index'
};
module.exports = Object.keys(entries).map(entryPoint => {
const entryRequest = entries[entryPoint];
return {
entry: { [entryPoint]: entryRequest },
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, `${entryPoint}/index.html`),
filename: '../index.html'
})
],
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, entryPoint, 'dist')
},
devServer: {
contentBase: path.resolve(__dirname),
watchContentBase: true
}
};
});