mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-22 16:41:38 +03:00
design system: minifies bundle, builds two target directories
This commit is contained in:
parent
583cf46dcd
commit
6354546d60
10861
dist/index.js
vendored
10861
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -40,9 +40,10 @@
|
|||||||
"ws": "^7.3.0"
|
"ws": "^7.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-node-resolve": "^8.1.0",
|
||||||
"rollup": "^2.18.1",
|
"rollup": "^2.18.1",
|
||||||
"rollup-plugin-babel": "^4.4.0",
|
"rollup-plugin-babel": "^4.4.0",
|
||||||
"rollup-plugin-commonjs": "^10.1.0",
|
"rollup-plugin-commonjs": "^10.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^8.1.0"
|
"rollup-plugin-terser": "^6.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
import babel from "rollup-plugin-babel";
|
import babel from "rollup-plugin-babel";
|
||||||
import commonjs from "rollup-plugin-commonjs";
|
import commonjs from "rollup-plugin-commonjs";
|
||||||
import resolve from "@rollup/plugin-node-resolve";
|
import resolve from "@rollup/plugin-node-resolve";
|
||||||
|
import { terser } from "rollup-plugin-terser";
|
||||||
|
|
||||||
const input = "./components/system/index.js";
|
const input = "./components/system/index.js";
|
||||||
|
|
||||||
export default [
|
const generateOutput = (outputPath) => {
|
||||||
{
|
return {
|
||||||
input,
|
input,
|
||||||
output: {
|
output: {
|
||||||
file: "dist/index.js",
|
file: outputPath,
|
||||||
format: "cjs",
|
format: "cjs",
|
||||||
},
|
},
|
||||||
external: ["@emotion/react", "react", "react-dom"],
|
external: ["@emotion/react", "react", "react-dom"],
|
||||||
@ -38,6 +39,12 @@ export default [
|
|||||||
"node_modules/react-tippy/dist/react-tippy.js": ["Tooltip"],
|
"node_modules/react-tippy/dist/react-tippy.js": ["Tooltip"],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
terser(),
|
||||||
],
|
],
|
||||||
},
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default [
|
||||||
|
generateOutput("dist/index.js"),
|
||||||
|
generateOutput("../slate-react-system/src/index.js"),
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user