Guest User

Untitled

a guest
Aug 9th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. // Learn more about this file at:
  2. // https://victorzhou.com/blog/build-an-io-game-part-1/#2-builds--project-setup
  3. const path = require('path');
  4. const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  5. const HtmlWebpackPlugin = require('html-webpack-plugin');
  6.  
  7. module.exports = {
  8. entry: {
  9. game: './src/client/index.js',
  10. },
  11. output: {
  12. filename: '[name].[contenthash].js',
  13. path: path.resolve(__dirname, 'dist'),
  14. },
  15. module: {
  16. rules: [
  17. {
  18. test: /\.js$/,
  19. exclude: /node_modules/,
  20. use: {
  21. loader: "babel-loader",
  22. options: {
  23. presets: ['@babel/preset-env'],
  24. },
  25. },
  26. },
  27. {
  28. test: /\.css$/,
  29. use: [
  30. {
  31. loader: MiniCssExtractPlugin.loader,
  32. },
  33. 'css-loader',
  34. ],
  35. },
  36. ],
  37. },
  38. plugins: [
  39. new MiniCssExtractPlugin({
  40. filename: '[name].[contenthash].css',
  41. }),
  42. new HtmlWebpackPlugin({
  43. filename: 'index.html',
  44. template: 'src/client/html/index.html',
  45. }),
  46. ],
  47. };
  48.  
Add Comment
Please, Sign In to add comment