var path = require("path"); var webpack = require("webpack"); var fableUtils = require("fable-utils"); function resolve(filePath) { return path.join(__dirname, filePath) } var babelOptions = fableUtils.resolveBabelOptions({ presets: [ ["env", { "targets": { "browsers": "> 1%" }, "modules": false }] ], }); var isProduction = process.argv.indexOf("-p") >= 0; console.log("Bundling for " + (isProduction ? "production" : "development") + "..."); module.exports = { target: 'node', devtool: "source-map", entry: resolve('./src/FMarkFable/FMarkFable.fsproj'), output: { library: 'fmark', libraryTarget: "umd", filename: "fmark.js", path: path.resolve(__dirname, 'js') }, module: { rules: [ { test: /\.fs(x|proj)?$/, use: { loader: "fable-loader", options: { babel: babelOptions, define: isProduction ? [] : ["DEBUG"] } } }, { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: babelOptions }, } ] } };