mirror of
https://github.com/arthurfiorette/axios-cache-interceptor.git
synced 2025-12-08 17:36:16 +00:00
perf: optimized build config
This commit is contained in:
parent
6fd42b2358
commit
3a800d78ea
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
run: yarn build
|
||||
|
||||
- name: ESCheck
|
||||
run: yarn check
|
||||
run: yarn run check
|
||||
|
||||
- name: Publish to Codecov
|
||||
uses: codecov/codecov-action@v2.1.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// https://github.com/arthurfiorette/prettier-config
|
||||
|
||||
module.exports = require('@arthurfiorette/prettier-config')({
|
||||
tsdoc: true
|
||||
// plugins: ['prettier-plugin-organize-imports', 'prettier-plugin-jsdoc']
|
||||
tsdoc: true,
|
||||
plugins: ['prettier-plugin-organize-imports', 'prettier-plugin-jsdoc']
|
||||
});
|
||||
|
||||
@ -14,7 +14,8 @@ webpack --config build/webpack.config.js &
|
||||
tsc -p build/tsconfig.types.json &
|
||||
|
||||
# Add a simple index.d.ts file to type all dev builds
|
||||
echo "export * from '../dist/index.d.ts';" | tee dev/index.d.ts > /dev/null &
|
||||
echo "export * from '../dist/index';" | tee dev/index.d.ts > /dev/null &
|
||||
echo "export * from './index';" | tee dist/index.umd.d.ts > /dev/null &
|
||||
|
||||
wait
|
||||
|
||||
|
||||
@ -3,16 +3,22 @@
|
||||
# This script is used to check the umd's ecmascript compatibility.
|
||||
# It is intended to be run from the project's root directory.
|
||||
|
||||
echo "\nStarting checking...\n"
|
||||
yarn es-check es2017 dist/index.cjs dev/index.cjs dev/index.umd.js
|
||||
|
||||
es-check es2015 umd/es5.js &
|
||||
if [ $? -eq 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
es-check es2017 umd/index.js cjs/index.js &
|
||||
es-check es2017 esm/index.js --module &
|
||||
yarn es-check es2017 dist/index.mjs dev/index.mjs --module
|
||||
|
||||
es-check es2020 dev/index.umd.js dev/index.cjs &
|
||||
es-check es2020 dev/index.mjs --module &
|
||||
if [ $? -eq 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wait
|
||||
yarn es-check es5 dist/index.umd.js
|
||||
|
||||
echo "\nCheck done!"
|
||||
if [ $? -eq 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# :)
|
||||
@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "ESNext", // webpack converts to UMD
|
||||
// webpack converts to UMD or CJS if needed
|
||||
"module": "ESNext",
|
||||
"target": "ESNext",
|
||||
|
||||
// Emits all import helpers as an import to tslib
|
||||
@ -10,7 +11,10 @@
|
||||
|
||||
// No declaration
|
||||
"declaration": false,
|
||||
"declarationMap": false
|
||||
"declarationMap": false,
|
||||
|
||||
// This allow us to import javascript files from node_modules.
|
||||
"allowJs": true
|
||||
},
|
||||
"include": ["../src"]
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ const path = require('path');
|
||||
const TerserWebpackPlugin = require('terser-webpack-plugin');
|
||||
const { DefinePlugin } = require('webpack');
|
||||
|
||||
/** @type {(...args: string[]) => string} */
|
||||
const root = (...p) => path.resolve(__dirname, '..', ...p);
|
||||
|
||||
/**
|
||||
@ -60,6 +61,7 @@ const config = ({
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
// Include node_modules to parse all javascript files imported
|
||||
include: /src|node_modules/,
|
||||
test: /\.(ts|js)$/,
|
||||
loader: 'ts-loader',
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* Projects */
|
||||
"incremental": true /* Enable incremental compilation */,
|
||||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
||||
"tsBuildInfoFile": "./node_modules/ts-info.json", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
||||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
@ -97,5 +97,5 @@
|
||||
"skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
},
|
||||
"include": ["src", "test", "examples", "docs"]
|
||||
"include": ["src", "test", "examples", "docs", "build"]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user