From e4651c8d1bc1c416de553428bcfba137ca35ef91 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 7 Feb 2019 00:37:13 -0500 Subject: use a minimal webpack-based build env --- webpack.config.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 webpack.config.js (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..0538655 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,43 @@ +const path = require("path"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const CopyWebpackPlugin = require('copy-webpack-plugin'); + +module.exports = { + entry: { + index: "./src/index.js", + background: "./src/background.js" + }, + output: { + path: path.join(__dirname, "/dist"), + filename: "[name].js" + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: "babel-loader" + }, + }, + { + test: /\.css$/, + use: ["style-loader", "css-loader"] + }, + { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' } + ] + }, + plugins: [ + new HtmlWebpackPlugin({ + template: "./public/index.html" + }), + new CopyWebpackPlugin([ + {from:'./public/', to:'./'} + ]), + ], + optimization: { + splitChunks: { + chunks: 'all' + } + } +}; -- cgit v1.2.3