fix: enhance compile config

This commit is contained in:
春希 2020-03-31 21:27:13 +08:00
parent 49ac9a3f08
commit 2899149b9c
3 changed files with 6 additions and 8 deletions

View File

@ -27,7 +27,8 @@
"tsconfig-paths": "^3.9.0",
"tsconfig-paths-webpack-plugin": "^3.2.0",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11"
"webpack-cli": "^3.3.11",
"webpack-node-externals": "^1.7.2"
},
"ava": {
"compileEnhancements": false,

View File

@ -1,15 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "es2015",
"noImplicitAny": true,
"sourceMap": true,
"moduleResolution": "node",
"isolatedModules": true,
"target": "es5",
"strictNullChecks": true,
"inlineSources": false,
"lib": ["es2015"],
"lib": ["es6"],
"downlevelIteration": true,
"paths": {
"@/*": ["./src/*"]

View File

@ -1,4 +1,5 @@
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
@ -6,7 +7,7 @@ module.exports = {
target: 'node',
entry: {
index: './src/index.ts',
// demo: './src/demo/main.ts',
demo: './src/demo/main.ts',
},
module: {
rules: [
@ -26,4 +27,5 @@ module.exports = {
filename: '[name].js',
path: path.resolve(__dirname, 'lib'),
},
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
};