Why the webpack increases the output file so large -


i wrote simple script within typescript , es6 has nothing todo react or library. however, source files less 200 lines (<5k) exported bundle.js around 100k. it's unreasonable.

here's webpack config. generated bundle.js webpack node_env=production --optimize-minimize

the file exceed 300k if not doing optimize.

        var webpack = require('webpack');         module.exports = {             entry: {                 timer: "./src/test.ts",             },             output: {                 path: "./js",                 filename: "[name]-bundle.js"             },              devtool: 'source-map',             resolve: {                 extensions: ['', '.ts', '.tsx', '.js', '.json']             },             module: {                 preloaders: [                     {test: /\.json$/, exclude: /node_modules/, loader: 'json'},                 ],                 loaders: [                     {test: /\.tsx?$/, loader: 'ts-loader'},                     {test: /\.scss$/, loaders: ['style', 'css', 'sass']},                     {                         test: /\.css$/,                         loader: 'style!css!'                     },                     {test: /\.png$/, loader: 'url-loader?mimetype=image/png'},                     {test: /\.json$/, loader: 'json'}                 ],                 preloaders: [                     {test: /\.js$/, loader: 'source-map-loader'}                 ]             },             devserver: {                 stats: 'errors-only',                 hot: true             },             plugins: [                 new webpack.hotmodulereplacementplugin(),                 new webpack.defineplugin({                     'process.env': 'production'                 })             ],             target: 'node'         }; 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -