Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'whatwg-fetch',
'./src/index.tsx'
];
module.exports = {
context: process.cwd(), // to automatically find tsconfig.json
entry: {
main
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
publicPath: "/"
},
plugins: [
new ForkTsCheckerWebpackPlugin(PnpWebpackPlugin.forkTsCheckerOptions({
tslint: true,
useTypescriptIncrementalApi: false, // not possible to use this until: https://github.com/microsoft/TypeScript/issues/31056
})),
new ForkTsCheckerNotifierWebpackPlugin({ title: 'TypeScript', excludeWarnings: false }),
new HtmlWebpackPlugin({
inject: true,
template: 'src/index.html'
}),
],
module: {
rules: [
{
test: /.tsx?$/,
loader: require.resolve("ts-loader"),
options: PnpWebpackPlugin.tsLoaderOptions({ transpileOnly: true })
}
'core-js',
'whatwg-fetch',
'./src/index.tsx'
];
module.exports = {
context: process.cwd(), // to automatically find tsconfig.json
entry: {
main: main
},
output: {
path: path.join(process.cwd(), 'dist'),
filename: '[name].js',
},
plugins: [
new ForkTsCheckerWebpackPlugin(PnpWebpackPlugin.forkTsCheckerOptions({
async: false,
useTypescriptIncrementalApi: false, // not possible to use this until: https://github.com/microsoft/TypeScript/issues/31056
memoryLimit: 4096
})),
new HtmlWebpackPlugin({
hash: true,
inject: true,
template: 'src/index.html',
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
config.experimental.css &&
!isServer &&
!dev &&
new MiniCssExtractPlugin({
filename: 'static/css/[contenthash].css',
chunkFilename: 'static/css/[contenthash].chunk.css',
}),
tracer &&
new ProfilingPlugin({
tracer,
}),
!isServer &&
useTypeScript &&
!ignoreTypeScriptErrors &&
new ForkTsCheckerWebpackPlugin(
PnpWebpackPlugin.forkTsCheckerOptions({
typescript: typeScriptPath,
async: dev,
useTypescriptIncrementalApi: true,
checkSyntacticErrors: true,
tsconfig: tsConfigPath,
reportFiles: ['**', '!**/__tests__/**', '!**/?(*.)(spec|test).*'],
compilerOptions: { isolatedModules: true, noEmit: true },
silent: true,
formatter: 'codeframe',
})
),
config.experimental.modern &&
!isServer &&
!dev &&
new NextEsmPlugin({
filename: (getFileName: Function | string) => (...args: any[]) => {