|
|
@@ -0,0 +1,53 @@
|
|
|
+const webpack = require('webpack');
|
|
|
+const helpers = require('./helpers');
|
|
|
+
|
|
|
+/*
|
|
|
+ * Webpack Plugins
|
|
|
+ */
|
|
|
+// problem with copy-webpack-plugin
|
|
|
+const AssetsPlugin = require('assets-webpack-plugin');
|
|
|
+const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
|
|
|
+const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
+const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
+const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
|
|
|
+const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
|
|
|
+
|
|
|
+/*
|
|
|
+ * Webpack Constants
|
|
|
+ */
|
|
|
+const HMR = helpers.hasProcessFlag('hot');
|
|
|
+
|
|
|
+/*
|
|
|
+ * Webpack configuration
|
|
|
+ *
|
|
|
+ * See: http://webpack.github.io/docs/configuration.html#cli
|
|
|
+ */
|
|
|
+module.exports = function (options) {
|
|
|
+ isProd = options.env === 'production';
|
|
|
+ return {
|
|
|
+ entry: {
|
|
|
+ 'app': './resource/js/app.js',
|
|
|
+ 'crowi-legacy': './resource/js/legacy/crowi.js',
|
|
|
+ 'presentation': './resource/js/crowi-presentation.js',
|
|
|
+ },
|
|
|
+ resolve: {
|
|
|
+ modules: [
|
|
|
+ './node_modules', './resource/thirdparty-js',
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ module: {
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ test: /.jsx?$/,
|
|
|
+ exclude: /node_modules/,
|
|
|
+ use: [{
|
|
|
+ loader: 'babel-loader',
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ plugins: []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = config;
|