-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
163 additions
and
86 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 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
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
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
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 |
---|---|---|
|
@@ -9,10 +9,16 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"main": "dist/index.js", | ||
"main": "dist/layered-loader", | ||
"exports": { | ||
"import": "./dist/layered-loader.js", | ||
"require": "./dist/layered-loader.cjs" | ||
}, | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsc", | ||
"build:release": "del-cli dist && del-cli coverage && npm run lint && npm run build:rollup", | ||
"build:rollup": "rollup --config", | ||
"docker:start": "docker-compose -f docker-compose.yml up --build -d redis && docker-compose -f docker-compose.yml up --build -d wait_for_redis", | ||
"docker:stop": "docker-compose -f docker-compose.yml down", | ||
"test": "jest --runInBand", | ||
|
@@ -21,7 +27,7 @@ | |
"lint": "eslint \"lib/**/*.ts\" \"test/**/*.ts\"", | ||
"lint:fix": "eslint --fix \"lib/**/*.ts\" \"test/**/*.ts\"", | ||
"prettier": "prettier --write \"{lib,test}/**/*.{js,ts}\" index.ts", | ||
"prepublishOnly": "npm run build" | ||
"prepublishOnly": "npm run build:release" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
|
@@ -47,13 +53,16 @@ | |
], | ||
"homepage": "https://github.com/kibertoad/layered-loader", | ||
"dependencies": { | ||
"toad-cache": "^2.1.0" | ||
"toad-cache": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"@rollup/plugin-typescript": "^11.1.0", | ||
"@types/jest": "^29.5.0", | ||
"@types/node": "^18.15.11", | ||
"@typescript-eslint/eslint-plugin": "^5.57.0", | ||
"@typescript-eslint/parser": "^5.57.0", | ||
"del-cli": "^5.0.0", | ||
"eslint": "^8.37.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
|
@@ -62,6 +71,7 @@ | |
"jest": "29.5.0", | ||
"prettier": "^2.8.7", | ||
"rfdc": "^1.3.0", | ||
"rollup": "^3.20.2", | ||
"ts-jest": "29.1.0", | ||
"typescript": "5.0.3" | ||
}, | ||
|
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,56 @@ | ||
import terser from '@rollup/plugin-terser' | ||
import typescript from '@rollup/plugin-typescript' | ||
import { createRequire } from 'node:module' | ||
const require = createRequire(import.meta.url) | ||
const pkg = require('./package.json') | ||
const year = new Date().getFullYear() | ||
const bannerLong = `/** | ||
* ${pkg.name} | ||
* | ||
* @copyright ${year} ${pkg.author} | ||
* @license ${pkg.license} | ||
* @version ${pkg.version} | ||
*/` | ||
const bannerShort = `/*! | ||
${year} ${pkg.author} | ||
@version ${pkg.version} | ||
*/` | ||
const defaultOutBase = { compact: true, banner: bannerLong, name: pkg.name } | ||
const cjOutBase = { ...defaultOutBase, compact: false, format: 'cjs', exports: 'named' } | ||
const esmOutBase = { ...defaultOutBase, format: 'esm' } | ||
const umdOutBase = { ...defaultOutBase, format: 'umd' } | ||
const minOutBase = { banner: bannerShort, name: pkg.name, plugins: [terser()], sourcemap: true } | ||
|
||
export default [ | ||
{ | ||
input: './index.ts', | ||
output: [ | ||
{ | ||
...cjOutBase, | ||
file: `dist/${pkg.name}.cjs`, | ||
}, | ||
{ | ||
...esmOutBase, | ||
file: `dist/${pkg.name}.js`, | ||
}, | ||
{ | ||
...esmOutBase, | ||
...minOutBase, | ||
file: `dist/${pkg.name}.min.js`, | ||
}, | ||
{ | ||
...umdOutBase, | ||
file: `dist/${pkg.name}.umd.js`, | ||
name: 'layered-loader', | ||
}, | ||
{ | ||
...umdOutBase, | ||
...minOutBase, | ||
file: `dist/${pkg.name}.umd.min.js`, | ||
name: 'layered-loader', | ||
}, | ||
], | ||
plugins: [typescript()], | ||
external: ['toad-cache'] | ||
}, | ||
] |
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
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
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
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
Oops, something went wrong.