]> git.r.bdr.sh - rbdr/serpentity/blobdiff - config/webpack.cjs
Bump version, require node 13, use cjs webpack
[rbdr/serpentity] / config / webpack.cjs
diff --git a/config/webpack.cjs b/config/webpack.cjs
new file mode 100644 (file)
index 0000000..a36c166
--- /dev/null
@@ -0,0 +1,40 @@
+const Path = require('path');
+
+module.exports = {
+  entry: {
+    serpentity: './lib/serpentity.js',
+    'serpentity.min': './lib/serpentity.js'
+  },
+
+  output: {
+    path: Path.resolve(__dirname, '../dist'),
+    filename: '[name].js',
+    library: 'Serpentity',
+    libraryTarget: 'umd'
+  },
+
+  module: {
+    rules: [
+      {
+        test: /\.js$/,
+        exclude: /(node_modules|doc)/,
+        use: 'babel-loader'
+      }
+    ]
+  },
+
+  resolve: {
+    modules: [
+      'node_modules',
+      Path.resolve(__dirname, '../lib')
+    ],
+
+    extensions: ['.js']
+  },
+
+  context: Path.resolve(__dirname, '..'),
+
+  optimization: {
+    minimize: true
+  }
+};