From 137f4369c2e1194da3bb733193b8636f7ae4c028 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Sun, 20 Oct 2019 23:21:17 +0200 Subject: 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 --- webpack.config.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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..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 -- cgit v1.2.3