const path = require('path');
module.exports = {
mode: 'production',
entry: './src/index.ts',
output: {
filename: "index.js",
path: path.resolve(__dirname, 'dist'),
libraryTarget: "umd",
clean: true,
globalObject: 'this',
umdNamedDefine: true,
},
resolve: {
extensions: ['.ts', '.tsx']
},
externals: {
react: 'react'
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
sourceMap: true,
},
},
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
{
test: /\.svg$/,
use: ['@svgr/webpack'],
},
{
test: /\.(ts|tsx)?$/,
use: ['ts-loader'],
exclude: /node_modules/
}
]
}
}
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
},
"target": "ESNext",
"useDefineForClassFields": true,
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"outDir": "./dist/",
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"jsx": "react-jsx"
},
"include": [
"src",
"src/@types/declaration.d.ts"
],
"exclude": [
"node_modules",
"dist",
"./src/stories"
]
}