Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Learn more about this file at:
- // https://victorzhou.com/blog/build-an-io-game-part-1/#2-builds--project-setup
- const path = require('path');
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- module.exports = {
- entry: {
- game: './src/client/index.js',
- },
- output: {
- filename: '[name].[contenthash].js',
- path: path.resolve(__dirname, 'dist'),
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: {
- loader: "babel-loader",
- options: {
- presets: ['@babel/preset-env'],
- },
- },
- },
- {
- test: /\.css$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader,
- },
- 'css-loader',
- ],
- },
- ],
- },
- plugins: [
- new MiniCssExtractPlugin({
- filename: '[name].[contenthash].css',
- }),
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: 'src/client/html/index.html',
- }),
- ],
- };
Add Comment
Please, Sign In to add comment