summaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorYukai Huang2016-10-07 23:05:23 +0800
committerYukai Huang2016-10-08 08:13:40 +0800
commit325d1f1a326a4ef5eaa070e56665c9b5680f1e36 (patch)
tree66e18bd4376e96c8e40f3b43a7757e99ba8894ee /webpack.config.js
parentf0269a161c06dc3a9990a4c82b30e500d690d30b (diff)
Create webpack config
Diffstat (limited to '')
-rw-r--r--webpack.config.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 00000000..01adea94
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,64 @@
+var webpack = require('webpack');
+var path = require('path');
+var ExtractTextPlugin = require("extract-text-webpack-plugin");
+
+module.exports = {
+ plugins: [
+ new webpack.ProvidePlugin({
+ '_': 'lodash',
+ jquery: "jquery",
+ jQuery: "jquery",
+ $: "jquery",
+ "window.jQuery": "jquery",
+ Visibility: "visibilityjs",
+ Cookies: "js-cookie",
+ CodeMirror: "codemirror"
+ }),
+ new webpack.DefinePlugin({
+ "require.specified": "require.resolve"
+ })
+ ],
+
+ entry: {
+ app: path.join(__dirname, 'public/js/app.js')
+ },
+
+ output: {
+ path: path.join(__dirname, 'public/build/js'),
+ filename: '[name].js'
+ },
+
+ resolve: {
+ root: [
+ path.resolve(__dirname, 'src'),
+ path.resolve(__dirname, 'node_modules')
+ ],
+ extensions: ["", ".js"],
+ alias: {
+ 'jquery-ui': 'jquery-ui/ui/widgets'
+ }
+ },
+
+ module: {
+ loaders: [{
+ test: /\.json$/,
+ loader: 'json-loader'
+ }, {
+ test: /\.css$/,
+ loader: ExtractTextPlugin.extract({
+ fallbackLoader: "style-loader",
+ loader: "css-loader"
+ })
+ }, {
+ test: /\.scss$/,
+ loaders: ['style', 'css', 'sass']
+ }, {
+ test: require.resolve("js-sequence-diagrams"),
+ loader: "imports?Raphael=raphael"
+ }]
+ },
+
+ node: {
+ fs: "empty"
+ }
+};