mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 10:17:23 -05:00
* Added polyscript/service-worker as workaround for missing sabayon * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated polyscript to its latest * Updated polyscript one mor time --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
68 lines
1.7 KiB
JavaScript
68 lines
1.7 KiB
JavaScript
// This file generates /core.js minified version of the module, which is
|
|
// the default exported as npm entry.
|
|
|
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
import commonjs from "@rollup/plugin-commonjs";
|
|
import terser from "@rollup/plugin-terser";
|
|
import postcss from "rollup-plugin-postcss";
|
|
|
|
const plugins = [];
|
|
|
|
export default [
|
|
{
|
|
input: "./src/core.js",
|
|
plugins: plugins.concat(
|
|
process.env.NO_MIN
|
|
? [nodeResolve(), commonjs()]
|
|
: [nodeResolve(), commonjs(), terser()],
|
|
),
|
|
output: {
|
|
esModule: true,
|
|
dir: "./dist",
|
|
sourcemap: true,
|
|
},
|
|
},
|
|
{
|
|
input: "./src/core.css",
|
|
plugins: [
|
|
postcss({
|
|
extract: true,
|
|
sourceMap: false,
|
|
minimize: !process.env.NO_MIN,
|
|
plugins: [],
|
|
}),
|
|
],
|
|
output: {
|
|
file: "./dist/core.css",
|
|
},
|
|
onwarn(warning, warn) {
|
|
if (warning.code === "FILE_NAME_CONFLICT") return;
|
|
warn(warning);
|
|
},
|
|
},
|
|
{
|
|
input: "./src/storage.js",
|
|
plugins: plugins.concat(
|
|
process.env.NO_MIN
|
|
? [nodeResolve(), commonjs()]
|
|
: [nodeResolve(), commonjs(), terser()],
|
|
),
|
|
output: {
|
|
esModule: true,
|
|
dir: "./dist",
|
|
sourcemap: true,
|
|
},
|
|
},
|
|
{
|
|
input: "./src/service-worker.js",
|
|
plugins: plugins.concat(
|
|
process.env.NO_MIN
|
|
? [nodeResolve(), commonjs()]
|
|
: [nodeResolve(), commonjs(), terser()],
|
|
),
|
|
output: {
|
|
file: "./dist/service-worker.js",
|
|
},
|
|
},
|
|
];
|