fire.app/webpack.config.js

49 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-02-08 13:37:13 +03:00
const webpackCopy = require('copy-webpack-plugin');
const webpack = require('webpack');
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const outputDirectory = 'dist';
module.exports = {
mode: 'development',
entry: {
2020-02-29 09:48:56 +03:00
bootstrap: ['./src/main.js']
2020-02-08 13:37:13 +03:00
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, outputDirectory),
globalObject: `(typeof self !== 'undefined' ? self : this)`
},
node: {
fs: 'empty'
},
plugins: [
new CleanWebpackPlugin(),
new webpack.DefinePlugin({
'typeof window': JSON.stringify('object')
2020-02-29 09:48:56 +03:00
})
2020-02-08 13:37:13 +03:00
],
devtool: '#source-map',
//devtool: 'none',
resolve: {
modules: ['node_modules', 'src'],
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js', '.css']
},
module: {
rules: [
{ parser: { system: false } },
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader'
},
{
test: /\.(jpe?g|gif|png|svg|woff|ttf|eot|wav|mp3)$/,
loader: 'file-loader'
}
]
}
};