aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorNaafiyan Ahmed <naafiyan@gmail.com>2022-03-17 16:35:32 -0400
committerNaafiyan Ahmed <naafiyan@gmail.com>2022-03-17 16:35:32 -0400
commitcb5f0847b098d89a1390acf90579b3c7fbc5ac3e (patch)
tree0266608b61495b5903ff419fa26e04fb5fbeef0a /webpack.config.js
parentf1f341b53a1a49427cf7ef40afdcd95a9b0e4e9d (diff)
parent5c874c6829d9957696dfe61014173b6800c864df (diff)
Merge branch 'naafi-linking' of https://github.com/brown-dash/Dash-Web into naafi-linking
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js45
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