-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve build system and stability
- Loading branch information
pooya parsa
committed
Jun 7, 2020
1 parent
a886f61
commit 5c3ee63
Showing
10 changed files
with
2,851 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
console.time('esm_init') | ||
const esm = require('esm')(module, { cache: false }) | ||
console.timeEnd('esm_init') | ||
|
||
for (let i = 0; i < 3; i++) { | ||
console.time('esm_require') | ||
esm('../fixtures/esm').test() | ||
console.timeEnd('esm_require') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
console.time('jiti_init') | ||
const jiti = require('../..')(__filename) | ||
console.timeEnd('jiti_init') | ||
|
||
for (let i = 0; i < 3; i++) { | ||
console.time('jiti_require') | ||
jiti('../fixtures/esm').test() | ||
console.timeEnd('jiti_require') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
const jiti = require('..')(__filename) | ||
|
||
console.log(jiti('./fixtures/esm').test()) | ||
console.log(jiti('./fixtures/typescript').test()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const path = require('path') | ||
|
||
const isProd = process.env.NODE_ENV === 'production' | ||
|
||
module.exports = { | ||
target: 'node', | ||
mode: isProd ? 'production' : 'development', | ||
entry: { | ||
jiti: './src/jiti.ts' | ||
}, | ||
devtool: false, | ||
output: { | ||
filename: '[name].js', | ||
path: path.resolve(__dirname, 'dist'), | ||
libraryTarget: 'commonjs2', | ||
libraryExport: 'default' | ||
}, | ||
resolve: { | ||
extensions: ['.tsx', '.ts', '.js'] | ||
}, | ||
stats: { | ||
// preset: 'detailed', | ||
warningsFilter: [/critical dependency:/i] | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
use: 'ts-loader', | ||
exclude: /node_modules/ | ||
} | ||
] | ||
}, | ||
node: false, | ||
optimization: { | ||
nodeEnv: false, | ||
moduleIds: 'named', | ||
chunkIds: 'named', | ||
splitChunks: { | ||
chunks: 'all' | ||
} | ||
} | ||
} |
Oops, something went wrong.