Skip to content

Commit

Permalink
Merge pull request #5 from rawpixel-vincent/update-build
Browse files Browse the repository at this point in the history
update build
  • Loading branch information
rawpixel-vincent authored Oct 10, 2024
2 parents 7841b88 + 5375e25 commit ab29e2b
Show file tree
Hide file tree
Showing 10 changed files with 472 additions and 84 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
"overrides": [],
"ignorePatterns": ["*.cjs", "*.min.js"],
"parserOptions": {
"ecmaVersion": 14,
"sourceType": "module"
"ecmaVersion": 15,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
}
}
129 changes: 129 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import * as esbuild from 'esbuild';
import { swcPlugin } from 'esbuild-plugin-swc';

await esbuild.build({
entryPoints: ['strict.js'],
bundle: true,
format: 'esm',
minify: true,
keepNames: true,
legalComments: 'inline',
target: ['chrome64', 'edge89', 'firefox88', 'safari13', 'opera76'],
outfile: 'strict.min.js',
plugins: [
swcPlugin({
env: {
targets: {
chrome: '64',
edge: '89',
firefox: '88',
safari: '13',
opera: '76',
},
},
module: {
type: 'es6',
},
}),
],
});
await esbuild.build({
entryPoints: ['strict.js'],
bundle: true,
format: 'cjs',
minify: true,
keepNames: true,
legalComments: 'inline',
target: ['chrome64', 'edge89', 'firefox88', 'safari13', 'opera76'],
outfile: 'strict.min.cjs',
plugins: [
swcPlugin({
env: {
targets: {
chrome: '64',
edge: '89',
firefox: '88',
safari: '13',
opera: '76',
},
},
module: {
type: 'commonjs',
},
}),
],
});
await esbuild.build({
entryPoints: ['stringList.js'],
bundle: true,
format: 'cjs',
minify: true,
keepNames: true,
legalComments: 'inline',
target: ['node18'],
outfile: 'stringList.cjs',
plugins: [
swcPlugin({
env: {
targets: {
node: '18',
},
},
module: {
type: 'commonjs',
},
}),
],
});
await esbuild.build({
entryPoints: ['stringList.js'],
bundle: true,
format: 'cjs',
minify: true,
keepNames: true,
legalComments: 'inline',
target: ['chrome64', 'edge89', 'firefox88', 'safari13', 'opera76'],
outfile: 'stringList.min.cjs',
plugins: [
swcPlugin({
env: {
targets: {
chrome: '64',
edge: '89',
firefox: '88',
safari: '13',
opera: '76',
},
},
module: {
type: 'commonjs',
},
}),
],
});
await esbuild.build({
entryPoints: ['stringList.js'],
bundle: true,
format: 'esm',
minify: true,
keepNames: true,
legalComments: 'inline',
target: ['chrome64', 'edge89', 'firefox88', 'safari13', 'opera76'],
outfile: 'stringList.min.js',
plugins: [
swcPlugin({
module: {
type: 'es6',
},
env: {
targets: {
chrome: '64',
edge: '89',
firefox: '88',
safari: '13',
opera: '76',
},
},
}),
],
});
14 changes: 10 additions & 4 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"rootDir": ".",
"module": "NodeNext",
"target": "ESNext",
"module": "Preserve",
"target": "ES6",
"lib": ["ESNext", "DOM"],
"moduleResolution": "nodenext",
"moduleResolution": "Bundler",
"resolveJsonModule": false,
"esModuleInterop": false,
"checkJs": true,
Expand All @@ -17,7 +17,13 @@
"disableSizeLimit": true,
"isolatedModules": true,
"removeComments": false,
"maxNodeModuleJsDepth": 0
"maxNodeModuleJsDepth": 0,
"disableReferencedProjectLoad": true,
"disableSourceOfProjectReferenceRedirect": true,
"extendedDiagnostics": false,
"diagnostics": false,
"assumeChangesOnlyAffectDirectDependencies": true,
"disableSolutionSearching": true
},
"include": [
"*.d.ts",
Expand Down
Loading

0 comments on commit ab29e2b

Please sign in to comment.