-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switched to Rollup build * Added IIFE/UMD build * Added browser test (for local use) * Updated CI accordingly
- Loading branch information
Showing
19 changed files
with
1,070 additions
and
156 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
other/ | ||
dist/ | ||
lib/ |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.vscode | ||
*.code-workspace | ||
other/ | ||
.vscode/ | ||
node_modules | ||
dist | ||
lib | ||
dist/ | ||
lib/ | ||
package-lock.json | ||
*.tgz |
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,7 +1,7 @@ | ||
dist | ||
lib | ||
.vscode | ||
*.code-workspace | ||
other/ | ||
dist/ | ||
lib/ | ||
.vscode/ | ||
node_modules | ||
package-lock.json | ||
*.tgz | ||
|
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,92 @@ | ||
// Install: | ||
// npm install -D @rollup/plugin-terser @rollup/plugin-commonjs | ||
// import typescript from '@rollup/plugin-typescript' | ||
// import terser from '@rollup/plugin-terser' | ||
// import commonjs from '@rollup/plugin-commonjs' | ||
import esbuild from 'rollup-plugin-esbuild' | ||
import dts from 'rollup-plugin-dts' | ||
// import {RollupOptions} from 'rollup' | ||
|
||
const isProduction = process.env.NODE_ENV === 'production' | ||
|
||
// See: https://rollupjs.org/guide/en/#outputformat | ||
|
||
export default [ | ||
{ | ||
input: 'src/index.ts', | ||
// plugins: [typescript(), isProduction && terser()], | ||
plugins: [ | ||
esbuild({ | ||
sourceMap: !isProduction, | ||
minify: isProduction, | ||
}), | ||
], | ||
output: [ | ||
{ | ||
file: `${isProduction ? 'dist' : 'lib'}/index.esm.js`, | ||
format: 'esm', | ||
// sourcemap: isProduction, | ||
}, | ||
{ | ||
name: 'isApng', | ||
file: `${isProduction ? 'dist' : 'lib'}/index.cjs.js`, | ||
format: 'cjs', | ||
// interop: 'auto', | ||
// sourcemap: isProduction, | ||
}, | ||
{ | ||
name: 'isApng', | ||
file: `${isProduction ? 'dist' : 'lib'}/index.js`, | ||
format: 'umd', | ||
// sourcemap: isProduction, | ||
}, | ||
], | ||
}, | ||
// { | ||
// input: 'src/index.ts', | ||
// plugins: [ | ||
// esbuild({ | ||
// // All options are optional | ||
// include: /\.[jt]sx?$/, // default, inferred from `loaders` option | ||
// exclude: /node_modules/, // default | ||
// sourceMap: true, // default | ||
// // minify: true, | ||
// target: 'es2017', // default, or 'es20XX', 'esnext' | ||
// // jsx: 'transform', // default, or 'preserve' | ||
// // jsxFactory: 'React.createElement', | ||
// // jsxFragment: 'React.Fragment', | ||
// // Like @rollup/plugin-replace | ||
// // define: { | ||
// // __VERSION__: '"x.y.z"', | ||
// // }, | ||
// // tsconfig: 'tsconfig.json', // default | ||
// // Add extra loaders | ||
// // loaders: { | ||
// // // Add .json files support | ||
// // // require @rollup/plugin-commonjs | ||
// // '.json': 'json', | ||
// // // Enable JSX in .js files too | ||
// // '.js': 'jsx', | ||
// // }, | ||
// }), | ||
// // typescript(), | ||
// // commonjs(), | ||
// // isProduction && terser() | ||
// ], | ||
// output: { | ||
// name: 'isApng', | ||
// file: `${isProduction ? 'dist' : 'lib'}/index.cjs.js`, | ||
// format: 'cjs', | ||
// // interop: 'default', | ||
// interop: 'auto', | ||
// }, | ||
// }, | ||
{ | ||
input: `src/index.ts`, | ||
plugins: [dts()], | ||
output: { | ||
file: `${isProduction ? 'dist' : 'lib'}/index.d.ts`, | ||
format: 'es', | ||
}, | ||
}, | ||
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.