forked from derrickbeining/react-atom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.development.config.js
More file actions
51 lines (48 loc) · 1.26 KB
/
Copy pathwebpack.development.config.js
File metadata and controls
51 lines (48 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
'use strict';
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const PeerDepsExternalsPlugin = require('peer-deps-externals-webpack-plugin');
const libraryName = 'reactAtom';
const filename = 'react-atom';
module.exports = {
devtool: 'inline-source-map',
entry: `./src/${filename}.ts`,
externals: [nodeExternals()],
output: {
path: path.resolve(__dirname, 'dist'),
filename: filename + '.js',
libraryTarget: 'umd',
library: libraryName,
globalObject: "typeof self !== 'undefined' ? self : this",
pathinfo: false,
},
mode: 'development',
optimization: {
removeAvailableModules: false,
removeEmptyChunks: false,
splitChunks: false,
},
module: {
rules: [
{
exclude: /node_modules/,
test: /\.tsx?$/,
use: [
{loader: 'babel-loader'},
{
loader: 'ts-loader',
options: {
transpileOnly: true,
experimentalWatchApi: true,
},
},
],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
},
plugins: [new ForkTsCheckerWebpackPlugin(), new PeerDepsExternalsPlugin()],
};