-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
21,440 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
{ | ||
"name": "unplugin-starter", | ||
"name": "unplugin-sentry", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"packageManager": "[email protected]", | ||
"description": "Register global imports on demand for Vite and Webpack", | ||
"license": "MIT", | ||
"homepage": "https://github.com/antfu/unplugin-starter#readme", | ||
"homepage": "https://github.com/kricsleo/unplugin-sentry#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/antfu/unplugin-starter.git" | ||
"url": "git+https://github.com/kricsleo/unplugin-sentry.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/antfu/unplugin-starter/issues" | ||
"url": "https://github.com/kricsleo/unplugin-sentry/issues" | ||
}, | ||
"keywords": [ | ||
"unplugin", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
package-lock.json | ||
public/bundle* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright (c) 2017 [these people](https://github.com/rollup/rollup-starter-app/graphs/contributors) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# rollup-starter-app | ||
|
||
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* | ||
|
||
|
||
## Getting started | ||
|
||
Clone this repository and install its dependencies: | ||
|
||
```bash | ||
git clone https://github.com/rollup/rollup-starter-app | ||
cd rollup-starter-app | ||
npm install | ||
|
||
# or | ||
npx degit "rollup/rollup-starter-app" my-app | ||
cd my-app | ||
npm install | ||
``` | ||
|
||
The `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](https://date-fns.org). | ||
|
||
`npm run build` builds the application to `public/bundle.js`, along with a sourcemap file for debugging. | ||
|
||
`npm start` launches a server, using [serve](https://github.com/zeit/serve). Navigate to [localhost:3000](http://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. | ||
|
||
## License | ||
|
||
[MIT](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "rollup-starter-app", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^17.0.0", | ||
"@rollup/plugin-node-resolve": "^11.1.0", | ||
"npm-run-all": "^4.1.5", | ||
"rollup": "^2.36.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"serve": "^11.3.2" | ||
}, | ||
"dependencies": { | ||
"date-fns": "^2.16.1" | ||
}, | ||
"scripts": { | ||
"build": "rollup -c", | ||
"watch": "rollup -c -w", | ||
"dev": "npm-run-all --parallel start watch", | ||
"start": "serve public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<html> | ||
<head lang='en'> | ||
<meta charset='utf-8'> | ||
<meta name='viewport' content='width=device-width'> | ||
<title>rollup-starter-app</title> | ||
|
||
<style> | ||
body { | ||
font-family: 'Helvetica Neue', Arial, sans-serif; | ||
color: #333; | ||
font-weight: 300; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>rollup-starter-app</h1> | ||
<p>The time is <span id='time-now'>...</span></p> | ||
<script src='bundle.js'></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import { terser } from 'rollup-plugin-terser' | ||
import Unplugin from '../../dist/rollup' | ||
import { options } from '../../local.test' | ||
|
||
// `npm run build` -> `production` is true | ||
// `npm run dev` -> `production` is false | ||
const production = !process.env.ROLLUP_WATCH | ||
|
||
export default { | ||
input: 'src/main.js', | ||
output: { | ||
format: 'iife', // immediately-invoked function expression — suitable for <script> tags | ||
sourcemap: true, | ||
dir: 'dist', | ||
}, | ||
plugins: [ | ||
resolve(), // tells Rollup how to find date-fns in node_modules | ||
commonjs(), // converts date-fns to ES modules | ||
production && terser(), // minify, but only in production | ||
Unplugin({ | ||
...options, | ||
deploy: { | ||
env: 'production', | ||
}, | ||
}), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import update from './update.js'; | ||
|
||
// even though Rollup is bundling all your files together, errors and | ||
// logs will still point to your original source modules | ||
console.log('if you have sourcemaps enabled in your devtools, click on main.js:5 -->'); | ||
|
||
update(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import format from 'date-fns/format'; | ||
|
||
var span = document.querySelector('#time-now'); | ||
|
||
export default function update() { | ||
span.textContent = format(new Date(), 'h:mm:ssa'); | ||
setTimeout(update, 1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<a href="/__inspect/module?id=./main.ts&index=2" target="_blank" style="text-decoration: none; margin-top:10px; display: block;">visit /__inspect/ to inspect the intermediate state</a> | ||
<script type="module" src="./main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
document.getElementById('app')!.innerHTML = '__UNPLUGIN__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"dev": "nodemon -w '../src/**/*.ts' -e .ts -x vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"devDependencies": { | ||
"vite": "^3.1.4", | ||
"vite-plugin-inspect": "^0.7.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'vite' | ||
import Inspect from 'vite-plugin-inspect' | ||
import Unplugin from '../../src/vite' | ||
import { options } from '../../local.test' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
Inspect(), | ||
Unplugin(options), | ||
], | ||
build: { | ||
sourcemap: true, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
Oops, something went wrong.