aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 0000000..4e32da0
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,30 @@
+const path = require('path');
+
+module.exports = (env) => {
+ return {
+ // Environment dependent
+ mode: env == 'dev' ? 'development' : 'production',
+ devtool: env == 'dev' ? 'inline-source-map' : 'none',
+
+ // Constant
+ entry: {
+ edit: './assets/js/edit.js',
+ },
+ output: {
+ filename: 'assets/js/[name].bundle.js',
+ path: path.resolve(__dirname),
+ libraryTarget: 'window'
+ },
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: [
+ 'style-loader',
+ 'css-loader',
+ ],
+ },
+ ],
+ },
+ }
+}; \ No newline at end of file