Opinionated universal frontend bundler in browser
Opinionated frontend compiler in browser.
https://esm.sh
typescript
rollup-plugin-virtual-fs
rollup-plugin-http-resolve
typescript
rollup
npm install uniroll typescript rollup --save
import { bundle } from "uniroll";
const files = {
"/foo.tsx": "export default 1",
"/index.tsx": "import foo from 'foo';\nconsole.log('hello', foo)",
};
const bundled = await bundle({
files,
input: "/index.tsx",
});
const out = await bundled.generate({ format: "esm" });
console.log(out.output[0]);
Run compiler with same logics.
$ npm install uniroll-tools -g
$ uniroll foo.js -o out.js
TODO: Options Documentation
# If you are not on MacOS try running `yarn --ignore-platform` instead of `yarn install`.
yarn install
yarn build
yarn test
yarn add uniroll typescript rollup
# If you want to use uniroll-svelte, add svelte
Add this wepback rules
module.exports = {
// ...
module: {
rules: [
// ...
{
test: /\.js$/,
include: /pluginutils/, // for @rollup/pluginutils
type: "javascript/auto",
},
],
},
};
rollup-plugin-memfs
and add new rollup-plugin-virtual-fs
https://esm.sh
typescript
compiler instead of @babel/core
and dorp babel plugins.useInMemory: true
option. Just take fs
or memfs
.package.json
reading. Use importmaps
WICG/import-maps: How to control the behavior of JavaScript imports
MIT