Rich-Harris/rollup-plugin-loadz0r-issue-repro(新しいタブで開きます)
主要言語: JavaScript
- star 数
- 2
- watcher 数
- 0
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2018/08/26
主要言語: JavaScript
This repo exists to demonstrate an issue with rollup-plugin-loadz0r: because script src attributes are resolve relative to the current page, rather than the script doing the importing, it doesn't work if your scripts live in a sub-directory or if you're on a non-root page.
Webpack solves this with options.publicPath. Since Rollup is (normally) loaderless, it probably doesn't make sense to implement the same option in Rollup itself, but it might make sense to implement it in loadz0r.
Original README follows:
This repo contains a bare-bones example of how to create an application using Rollup, including importing a module from node_modules and converting it from CommonJS.
See also https://github.com/rollup/rollup-starter-lib
Clone this repository and install its dependencies:
git clone https://github.com/rollup/rollup-starter-app
cd rollup-starter-app
npm installThe public/index.html file contains a <script src='bundle.js'> tag, which means we need to create public/bundle.js. The rollup.config.js file tells Rollup how to create this bundle, starting with src/main.js and including all its dependencies, including date-fns.
npm run build builds the application to public/bundle.js, along with a sourcemap file for debugging.
npm start launches a server, using serve. Navigate to localhost:3000.
npm run watch will continually rebuild the application as your source files change.
npm run dev will run npm start and npm run watch in parallel.
MIT.