Skip to content

Commit

Permalink
fix: fixed register.js not found
Browse files Browse the repository at this point in the history
  • Loading branch information
DuCanhGH committed Nov 30, 2022
1 parent 29e643f commit 40cfb17
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 42 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
"license": "MIT",
"private": false,
"files": [
"dist",
"register.js"
"dist"
],
"source": "./src/index.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/ducanh2912-next-pwa.js",
"default": "./dist/ducanh2912-next-pwa.modern.mjs"
},
"./register": "./register.js"
}
},
"main": "./dist/ducanh2912-next-pwa.js",
"module": "./dist/ducanh2912-next-pwa.module.js",
Expand Down
87 changes: 49 additions & 38 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,54 @@ import terser from "@rollup/plugin-terser";
import typescript from "@rollup/plugin-typescript";
import { defineConfig } from "rollup";

export default defineConfig({
input: "src/index.ts",
output: [
{
file: "dist/ducanh2912-next-pwa.js",
format: "cjs",
exports: "named",
},
{
file: "dist/ducanh2912-next-pwa.modern.mjs",
format: "esm",
},
{
file: "dist/ducanh2912-next-pwa.module.js",
export default [
defineConfig({
input: "src/index.ts",
output: [
{
file: "dist/ducanh2912-next-pwa.js",
format: "cjs",
exports: "named",
},
{
file: "dist/ducanh2912-next-pwa.modern.mjs",
format: "esm",
},
{
file: "dist/ducanh2912-next-pwa.module.js",
format: "esm",
},
],
plugins: [
typescript({
noForceEmit: true,
noEmitOnError: true,
outDir: "dist",
declaration: true,
noEmit: false,
}),
terser(),
],
external: [
"clean-webpack-plugin",
"terser-webpack-plugin",
"workbox-webpack-plugin",
"webpack",
"crypto",
"fs",
"path",
"url",
"globby",
"workbox-window",
],
}),
defineConfig({
input: "src/register.js",
output: {
file: "dist/register.js",
format: "esm",
},
],
plugins: [
typescript({
noForceEmit: true,
noEmitOnError: true,
outDir: "dist",
declaration: true,
noEmit: false,
}),
terser(),
],
external: [
"clean-webpack-plugin",
"terser-webpack-plugin",
"workbox-webpack-plugin",
"webpack",
"crypto",
"fs",
"path",
"url",
"globby",
"workbox-window",
],
});
plugins: [terser()],
external: ["workbox-window"],
}),
];
File renamed without changes.

0 comments on commit 40cfb17

Please sign in to comment.