From 325d1f1a326a4ef5eaa070e56665c9b5680f1e36 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Fri, 7 Oct 2016 23:05:23 +0800 Subject: Create webpack config --- webpack.config.js | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 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 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" + } +}; -- cgit v1.2.3