diff options
author | Naafiyan Ahmed <naafiyan@gmail.com> | 2022-03-17 12:17:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-17 12:17:27 -0400 |
commit | 5c874c6829d9957696dfe61014173b6800c864df (patch) | |
tree | 23b7206679d500fc039a4302255cf3d6e17b47d3 /webpack.config.js | |
parent | a299d1766aa7f4bf3e6bbc3032a39b6b5ae28b4b (diff) | |
parent | 5a385e46937a2f79d557b4ee929e78ba78aca8bf (diff) |
Merge pull request #55 from brown-dash/speedups2
Speedups2
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/webpack.config.js b/webpack.config.js index 56bd428e4..3fd00bcf3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ var path = require('path'); var webpack = require('webpack'); const CopyWebpackPlugin = require("copy-webpack-plugin"); +const HtmlWebpackPlugin = require('html-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); const plugins = [ @@ -8,11 +9,16 @@ const plugins = [ from: "deploy", to: path.join(__dirname, "build") }]), + new HtmlWebpackPlugin({ + title: 'Caching', + }), new ForkTsCheckerWebpackPlugin({ tslint: true, + // memoryLimit: 4096, useTypescriptIncrementalApi: true }), - new webpack.optimize.OccurrenceOrderPlugin(), + new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'], }), + new webpack.ProvidePlugin({ process: 'process/browser', }), new webpack.HotModuleReplacementPlugin(), ]; @@ -45,24 +51,29 @@ module.exports = { inkControls: ["./src/mobile/InkControls.tsx", 'webpack-hot-middleware/client?reload=true'], mobileInterface: ["./src/mobile/MobileMain.tsx", 'webpack-hot-middleware/client?reload=true'], }, - optimization: { - noEmitOnErrors: true - }, devtool: "source-map", - node: { - fs: 'empty', - module: 'empty', - dns: 'mock', - tls: 'mock', - net: 'mock' - }, output: { filename: "[name].js", path: path.resolve(__dirname, "build"), - publicPath: "/" + publicPath: "/", }, resolve: { - extensions: ['.js', '.ts', '.tsx'] + extensions: ['.js', '.ts', '.tsx'], + fallback: { + fs: false, + tls: false, + net: false, + zlib: false, + dns: false, + crypto: false, + assert: false, + os: false, + path: require.resolve("path-browserify"), + http: require.resolve("http-browserify"), + https: require.resolve("https-browserify"), + stream: require.resolve("stream-browserify"), + buffer: require.resolve("buffer") + } }, module: { rules: [{ @@ -75,6 +86,12 @@ module.exports = { }] }, { + test: /\.m?js/, + resolve: { + fullySpecified: false + } + }, + { test: /\.(woff|woff2|ttf|eot|otf|svg)$/, use: 'file-loader?name=fonts/[name].[ext]!static' }, @@ -113,5 +130,5 @@ module.exports = { plugins, externals: [ 'child_process' - ] + ], };
\ No newline at end of file |