UNPKG

3.85 kBJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
7const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
8const tsconfig_paths_webpack_plugin_1 = __importDefault(require("tsconfig-paths-webpack-plugin"));
9const webpack_node_externals_1 = __importDefault(require("webpack-node-externals"));
10const env_1 = require("../util/env");
11const formatForkTsCheckerMessages_1 = require("./formatForkTsCheckerMessages");
12const formatTsLoaderMessages_1 = require("./formatTsLoaderMessages");
13const paths_1 = require("./paths");
14const tsLintHelper_1 = require("./tsLintHelper");
15exports.WebpackDevConfig = {
16 mode: 'development',
17 entry: paths_1.paths.appIndexJs,
18 target: 'node',
19 externals: [
20 webpack_node_externals_1.default(env_1.RuntimeOptions.useMonorepo
21 ? {
22 modulesFromFile: true,
23 }
24 : undefined),
25 ],
26 devtool: 'inline-source-map',
27 output: {
28 path: paths_1.paths.appDevBundlePath,
29 filename: 'bundle.js',
30 libraryTarget: 'commonjs',
31 },
32 resolve: {
33 extensions: ['.ts', '.tsx', '.js', 'jsx', '.json'],
34 plugins: [
35 new tsconfig_paths_webpack_plugin_1.default({
36 configFile: paths_1.paths.appTsConfig,
37 logLevel: 'ERROR',
38 }),
39 ],
40 },
41 module: {
42 rules: [
43 {
44 test: /\.tsx?$/,
45 enforce: 'pre',
46 use: [
47 {
48 loader: require.resolve('tslint-loader'),
49 options: {
50 emitErrors: tsLintHelper_1.tslintShouldEmitErrors(paths_1.paths.appTsLint),
51 tsConfigFile: paths_1.paths.appTsConfig,
52 configFile: paths_1.paths.appTsLint,
53 formatter: 'lintTable',
54 formattersDirectory: __dirname + '/formatters/',
55 },
56 },
57 ],
58 },
59 {
60 test: /\.jsx?$/,
61 include: paths_1.paths.appSrc,
62 exclude: /node_modules/,
63 loader: require.resolve('babel-loader'),
64 options: {
65 babelrc: false,
66 presets: [require.resolve('@babel/preset-env')],
67 compact: true,
68 },
69 },
70 {
71 test: /\.tsx?$/,
72 include: paths_1.paths.appSrc,
73 loader: require.resolve('ts-loader'),
74 options: {
75 transpileOnly: true,
76 experimentalWatchApi: true,
77 errorFormatter: formatTsLoaderMessages_1.formatTsLoaderMessages,
78 },
79 },
80 ],
81 },
82 plugins: [
83 new fork_ts_checker_webpack_plugin_1.default({
84 silent: true,
85 async: false,
86 watch: paths_1.paths.appSrc,
87 tsconfig: paths_1.paths.appTsConfig,
88 formatter: formatForkTsCheckerMessages_1.formatForkTsCheckerMessages,
89 checkSyntacticErrors: true,
90 reportFiles: ['**', '!**/__tests__/**', '!**/?(*.)(spec|test|t).*'],
91 }),
92 new case_sensitive_paths_webpack_plugin_1.default(),
93 ],
94 optimization: {
95 nodeEnv: false,
96 },
97 node: {
98 __dirname: false,
99 __filename: false,
100 },
101 performance: {
102 hints: false,
103 },
104};
105//# sourceMappingURL=webpack.config.dev.js.map
\No newline at end of file