diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..0f4f61bea --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,64 @@ +const webpack = require("webpack"); +const path = require("path"); + +const config = { + context: path.resolve(__dirname, "assets/static"), + entry: "./unsee.js", + output: { + path: path.resolve(__dirname, "assets/static/dist"), + publicPath: "../static/dist/", + filename: "bundle.js" + }, + plugins: [ + new webpack.ProvidePlugin({ + $: "jquery", + jQuery: "jquery" + }) + ], + module: { + rules: [ + { + test: require.resolve("jquery"), + use: "expose-loader?$!expose-loader?jQuery" + }, + { + test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, + use: "url-loader?limit=10000&mimetype=application/font-woff" + }, + { + test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, + use: "file-loader" + }, + { + test: /\.css$/, + use: "style-loader" + }, + { + test: /\.scss$/, + use: "style-loader" + }, + { + test: /\.less$/, + use: [ + { loader: "style-loader" }, + { loader: "css-loader" }, + { loader: "less-loader" } + ] + }, + { + test: /\.js$/, + include: path.resolve(__dirname, "assets/static"), + use: [ { + loader: "babel-loader", + options: { + presets: [ + [ "es2015", { modules: false } ] + ] + } + } ] + } + ] + }, +} + +module.exports = config