├── .github └── workflows │ └── main.yml ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── docs ├── circular.md ├── cli.md ├── compiler.md ├── dev-middleware.md ├── dev-server.md ├── hmr.md ├── live-bindings.md ├── nollup-hooks.md ├── nolluprc.md ├── options.md ├── plugins.md ├── rollup-config.md └── sdk.md ├── examples ├── README.md ├── example-amd │ ├── package.json │ ├── public │ │ ├── index.html │ │ ├── my-external-module-dynamic.js │ │ └── my-external-module.js │ ├── rollup.config.js │ └── src │ │ ├── dynamic-import-main.js │ │ ├── multiple-export-main.js │ │ ├── my-dynamic-module.js │ │ └── single-export-main.js ├── example-circular │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── A1.js │ │ ├── A2.js │ │ ├── A3.js │ │ ├── B.js │ │ └── main.js ├── example-dynamic-import │ ├── .babelrc │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── Counter.css │ │ ├── Counter.js │ │ └── main.js ├── example-emit-chunk │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── main.js │ │ ├── shared.js │ │ ├── worker-color.js │ │ └── worker-size.js ├── example-globals │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ └── main.js ├── example-https │ ├── .gitignore │ ├── cert │ │ ├── example.crt │ │ └── example.key │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ └── main.js ├── example-live-bindings │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── counter.js │ │ └── main.js ├── example-mjs-config │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.mjs │ └── src │ │ └── main.js ├── example-multi-bundle │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── entry-a.js │ │ ├── entry-b.js │ │ ├── message-a.js │ │ └── message-b.js ├── example-preact │ ├── .babelrc │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── Counter.css │ │ ├── Counter.js │ │ ├── Internal.js │ │ ├── Switch.css │ │ ├── Switch.js │ │ └── main.js ├── example-public-path │ ├── .babelrc │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── Counter.css │ │ ├── Counter.js │ │ └── main.js ├── example-react-esinstall │ ├── .babelrc │ ├── .gitignore │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── Counter.css │ │ ├── Counter.js │ │ ├── Internal.js │ │ └── main.js ├── example-react-hot-loader │ ├── .babelrc │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── Counter.css │ │ ├── Counter.js │ │ ├── Internal.js │ │ ├── Switch.css │ │ ├── Switch.js │ │ └── main.js ├── example-react-refresh │ ├── .babelrc │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── Counter.css │ │ ├── Counter.js │ │ ├── Internal.js │ │ └── main.js ├── example-single-file-bundle │ ├── .gitignore │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.js │ └── src │ │ ├── main.js │ │ └── message.js ├── example-typescript │ ├── package.json │ ├── public │ │ └── index.html │ ├── rollup.config.ts │ └── src │ │ ├── enum.ts │ │ └── main.ts └── example-virtual-index-html │ ├── .gitignore │ ├── package.json │ ├── rollup.config.js │ └── src │ ├── main.css │ └── main.js ├── jsconfig.json ├── lib ├── cli.js ├── dev-middleware.js ├── dev-server.js ├── impl │ ├── AcornParser.js │ ├── ConfigLoader.js │ ├── NollupCodeGenerator.js │ ├── NollupCompiler.js │ ├── NollupContext.js │ ├── NollupImportExportResolver.js │ ├── NollupLiveBindingsResolver.js │ ├── ParseError.js │ ├── PluginContainer.js │ ├── PluginContext.js │ ├── PluginErrorHandler.js │ ├── PluginLifecycle.js │ ├── PluginMeta.js │ ├── PluginUtils.js │ ├── RollupConfigContainer.js │ ├── types.js │ └── utils.js ├── index.js ├── plugin-hmr.js └── sdk.js ├── package.json └── test ├── cases ├── DevMiddleware.js ├── ErrorHandling.js ├── Externals.js ├── ImportExportResolver.js ├── PluginHMR.js ├── RequireUsage.js ├── Scenarios.js ├── StaticDynamicImportOptimisation.js ├── VirtualModules.js ├── api │ ├── context.js │ ├── generate.js │ ├── hooks.js │ └── nollup_hooks.js ├── misc.js └── options │ ├── context.js │ ├── input.js │ ├── moduleContext.js │ ├── output-assetFileNames.js │ ├── output-chunkFileNames.js │ ├── output-dir.js │ ├── output-entryFileNames.js │ ├── output-file.js │ └── output-format.js ├── nollup.js ├── packages ├── circular-deep │ ├── A.js │ ├── B.js │ ├── C.js │ ├── index.js │ └── message.js ├── circular-export-all-from │ ├── A.js │ ├── index.js │ └── letters.js ├── circular-export-fn-as │ ├── index.js │ └── other.js ├── circular-export-from-infinite-loop │ ├── A.js │ ├── index.js │ └── letters.js ├── circular-export-from │ ├── A.js │ ├── index.js │ └── letters.js ├── circular-hoist-class │ ├── index.js │ └── other.js ├── circular-hoist-fn-require │ ├── dynamic.js │ ├── index.js │ └── other.js ├── circular-hoist-var-patterns-extra │ ├── index.js │ └── other.js ├── circular-hoist-var-patterns │ ├── index.js │ └── other.js ├── circular-shared-import-timing │ ├── index.js │ ├── shared.js │ └── two.js ├── circular │ ├── A1.js │ ├── A2.js │ ├── A3.js │ ├── B.js │ └── index.js ├── empty-source-mapping │ ├── content.json │ └── index.js ├── export-all │ ├── impl.js │ ├── index-proxy.js │ └── index.js ├── export-checks │ ├── alias-dep-from.js │ ├── dep-from.js │ └── index.js ├── export-declaration-late-binding │ ├── index.js │ └── messages.js ├── export-default-from │ ├── impl.js │ └── index.js ├── export-full-live-bindings │ ├── counter.js │ └── index.js ├── export-import-delayed │ ├── impl.js │ └── index.js ├── export-same-export-as-from │ ├── hello.js │ ├── index.js │ └── world.js ├── export-synthetic-all-from │ ├── impl.js │ └── index.js ├── hello-world │ └── index.js └── multi-module │ ├── index.js │ ├── message │ ├── hello.js │ ├── index.js │ └── world.js │ └── sum │ ├── index.js │ ├── one.js │ ├── three.js │ └── two.js └── utils ├── evaluator-worker.js ├── evaluator.js └── wait.js /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | test: 19 | name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} 20 | runs-on: ${{ matrix.os }} 21 | strategy: 22 | matrix: 23 | node_version: ['14'] 24 | os: [ubuntu-latest, windows-latest] 25 | 26 | steps: 27 | - uses: actions/checkout@v1 28 | - name: Use Node.js ${{ matrix.node_version }} 29 | uses: actions/setup-node@v1 30 | with: 31 | node-version: ${{ matrix.node_version }} 32 | 33 | - name: npm install, build and test 34 | run: | 35 | npm install 36 | npm run test:mocha 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | dist/ 3 | *.log 4 | node_modules/ 5 | .DS_STORE 6 | *.swp 7 | .npm 8 | .eslintcache 9 | target/ 10 | *.stackdump 11 | package-lock.json 12 | *.tgz 13 | NOTES 14 | 15 | coverage/ 16 | TODO 17 | benchmark -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | examples/ 3 | NOTES 4 | example-project/ 5 | package-lock.json 6 | target/ 7 | .travis.yml 8 | API.md 9 | *.tgz 10 | coverage/ 11 | docs/ 12 | src/ 13 | rollup.config.js 14 | jsconfig.json 15 | benchmark/ 16 | TODO 17 | .github -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Paul Sweeney 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nollup 2 | 3 | ![CI](https://github.com/PepsRyuu/nollup/actions/workflows/main.yml/badge.svg) 4 | [![NPM Version](https://img.shields.io/npm/v/nollup.svg)](https://www.npmjs.com/package/nollup) 5 | [![License](https://badgen.net/github/license/pepsryuu/nollup)](./LICENSE) 6 | [![Downloads](https://img.shields.io/npm/dm/nollup)](https://www.npmjs.com/package/nollup) 7 | [![Contributors](https://img.shields.io/github/contributors/PepsRyuu/nollup)](https://github.com/PepsRyuu/nollup/graphs/contributors) 8 | [![Twitter](https://img.shields.io/twitter/follow/PepsRyuu?style=social)](https://twitter.com/PepsRyuu) 9 | 10 | ***No(t) Rollup → Nollup*** 11 | 12 | [Rollup](https://rollupjs.org/guide/en) compatible bundler, ***designed to be used in development***. Using the same Rollup plugins and configuration, it provides a dev server that performs **quick builds and rebuilds**, and other dev features such as **Hot Module Replacement**. 13 | 14 | ## Why Nollup? 15 | 16 | Rollup is an incredible tool, producing very efficient and minimal bundles. Many developers use it already to build libraries, but I wanted to use it to **build apps**. However, **Rollup focuses mostly on the production** side of things, with almost no developer experience other than basic file watching. Using Rollup in development can be incredibly slow with rebuilds taking seconds because of all of the optimisations Rollup does for you (ie. tree-shaking, scope-hoisting). 17 | 18 | Nollup aims to fill in that gap. Using the same Rollup plugins and configuration, **you can use Nollup to run a development server that generates a development bundle**. It does no optimisations, making it really **quick at rebuilding**, also allowing for Hot Module Replacement using existing ```module.hot``` conventions for **compatibility with existing libraries**. 19 | 20 | Read further about why I prefer using Rollup to build apps [here](https://medium.com/@PepsRyuu/why-i-use-rollup-and-not-webpack-e3ab163f4fd3). 21 | 22 | ## How to Use 23 | 24 | Nollup provides four ways to use it: 25 | 26 | * [Nollup CLI](./docs/cli.md) 27 | * [Dev Server API](./docs/dev-server.md) 28 | * [Dev Middleware API](./docs/dev-middleware.md) 29 | * [Compiler API](./docs/compiler.md) 30 | * [SDK 🧪](./docs/sdk.md) 31 | 32 | For the majority of projects, it is recommended to use the CLI approach. 33 | 34 | ## Quick Start 35 | 36 | [create-nollup-app](https://github.com/PepsRyuu/create-nollup-app) is a CLI that will generate a Nollup project for you. 37 | 38 | ``` 39 | // npm 6 and below 40 | npm init nollup-app --name --template