aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2019-10-20 23:21:17 +0200
committern-peugnet <n.peugnet@free.fr>2019-10-21 21:49:12 +0200
commit137f4369c2e1194da3bb733193b8636f7ae4c028 (patch)
tree32205f35e809bb02afd59460f56f0094271b7ade /webpack.config.js
parentba671a7c0880f8154a7b86d4cb172b0171e84021 (diff)
downloadwcms-137f4369c2e1194da3bb733193b8636f7ae4c028.tar.gz
wcms-137f4369c2e1194da3bb733193b8636f7ae4c028.zip
include CodeMirror in edit page
- add npm prerequisite - add codemirror through npm - add webpack trough npm to build the js bundles - add first codemirror enhenced textarea
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