Farmbot-Web-App/config/webpack.dev.js

69 lines
1.6 KiB
JavaScript
Raw Normal View History

2017-08-10 10:01:59 -06:00
var path = require("path");
2018-06-13 10:22:46 -06:00
var StatsPlugin = require('stats-webpack-plugin');
var host = process.env["API_HOST"] || "localhost"
2018-01-30 12:02:44 -07:00
var devServerPort = 3808;
2017-08-10 10:01:59 -06:00
2018-06-13 10:22:46 -06:00
module.exports = {
mode: "none",
output: {
// must match config.webpack.output_dir
path: path.join(__dirname, '..', 'public', 'webpack'),
publicPath: `//${host}:${devServerPort}/webpack/`,
filename: '[name].js'
},
entry: {
"app_bundle": "./webpack/entry.tsx",
"front_page": "./webpack/front_page/index.tsx",
"password_reset": "./webpack/password_reset/index.tsx",
"tos_update": "./webpack/tos_update/index.tsx"
},
2018-06-13 10:22:46 -06:00
devtool: "eval",
module: {
rules: [
{
test: [/\.scss$/, /\.css$/],
use: ["style-loader", "css-loader", "sass-loader"]
},
{
test: /\.tsx?$/,
2018-06-14 12:39:12 -06:00
use: "ts-loader"
2018-06-13 10:22:46 -06:00
},
{
test: [/\.woff$/, /\.woff2$/, /\.ttf$/],
use: "url-loader"
},
{
test: [/\.eot$/, /\.svg(\?v=\d+\.\d+\.\d+)?$/],
use: "file-loader"
}
]
},
// Allows imports without file extensions.
resolve: {
extensions: [".js", ".ts", ".tsx", ".css", ".scss", ".json"]
},
plugins: [
new StatsPlugin('manifest.json', {
// We only need assetsByChunkName
chunkModules: false,
source: false,
chunks: false,
modules: false,
assets: true
})
],
node: {
fs: "empty"
},
devServer: {
port: devServerPort,
disableHostCheck: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
host: "0.0.0.0",
headers: { 'Access-Control-Allow-Origin': '*' }
}
2017-08-15 09:58:02 -06:00
};