File tree Expand file tree Collapse file tree 7 files changed +729
-70
lines changed Expand file tree Collapse file tree 7 files changed +729
-70
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ const config = {
8
8
"plugin:@typescript-eslint/stylistic-type-checked" ,
9
9
"plugin:prettier/recommended" ,
10
10
] ,
11
+ ignorePatterns : [ "**/bundlers/**" ] ,
11
12
parserOptions : {
12
13
ecmaVersion : "latest" ,
13
14
sourceType : "module" ,
14
15
tsconfigRootDir : __dirname ,
15
16
project : [
16
17
"./tsconfig.json" ,
17
18
"./packages/bundler-plugin-core/tsconfig.json" ,
18
- "./packages/esbuild-plugin/tsconfig.json" ,
19
19
"./packages/rollup-plugin/tsconfig.json" ,
20
20
"./packages/vite-plugin/tsconfig.json" ,
21
21
"./packages/webpack-plugin/tsconfig.json" ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " rollup" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " " ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "build" : " rollup -c" ,
8
+ "watch" : " rollup -c -w" ,
9
+ "dev" : " npm-run-all --parallel start watch" ,
10
+ "start" : " serve public"
11
+ },
12
+ "keywords" : [],
13
+ "author" : " " ,
14
+ "license" : " ISC" ,
15
+ "dependencies" : {
16
+ "date-fns" : " ^2.16.1"
17
+ },
18
+ "devDependencies" : {
19
+ "@rollup/plugin-commonjs" : " ^17.0.0" ,
20
+ "@rollup/plugin-node-resolve" : " ^11.1.0" ,
21
+ "npm-run-all" : " ^4.1.5" ,
22
+ "rollup" : " ^2.36.2" ,
23
+ "rollup-plugin-terser" : " ^7.0.2" ,
24
+ "serve" : " ^11.3.2"
25
+ },
26
+ "volta" : {
27
+ "extends" : " ../../package.json"
28
+ },
29
+ "engines" : {
30
+ "node" : " >=20.0.0"
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < html >
3
+ < head lang ="en ">
4
+ < meta charset ="utf-8 " />
5
+ < meta name ="viewport " content ="width=device-width " />
6
+ < title > rollup-starter-app</ title >
7
+
8
+ < style >
9
+ body {
10
+ font-family : "Helvetica Neue" , Arial, sans-serif;
11
+ color : # 333 ;
12
+ font-weight : 300 ;
13
+ }
14
+ </ style >
15
+ </ head >
16
+ < body >
17
+ < h1 > rollup-starter-app</ h1 >
18
+ < p > The time is < span id ="time-now "> ...</ span > </ p >
19
+ < script src ="bundle.js "> </ script >
20
+ </ body >
21
+ </ html >
Original file line number Diff line number Diff line change
1
+ import resolve from "@rollup/plugin-node-resolve" ;
2
+ import commonjs from "@rollup/plugin-commonjs" ;
3
+ import { terser } from "rollup-plugin-terser" ;
4
+
5
+ // `npm run build` -> `production` is true
6
+ // `npm run dev` -> `production` is false
7
+ const production = ! process . env . ROLLUP_WATCH ;
8
+
9
+ export default {
10
+ input : "src/main.js" ,
11
+ output : {
12
+ dir : 'dist' ,
13
+ format : "iife" , // immediately-invoked function expression — suitable for <script> tags
14
+ sourcemap : true ,
15
+
16
+ } ,
17
+ plugins : [
18
+ resolve ( ) , // tells Rollup how to find date-fns in node_modules
19
+ commonjs ( ) , // converts date-fns to ES modules
20
+ production && terser ( ) , // minify, but only in production
21
+ ] ,
22
+ } ;
Original file line number Diff line number Diff line change
1
+ import update from "./update.js" ;
2
+
3
+ // even though Rollup is bundling all your files together, errors and
4
+ // logs will still point to your original source modules
5
+ console . log (
6
+ "if you have sourcemaps enabled in your devtools, click on main.js:5 -->" ,
7
+ ) ;
8
+
9
+ update ( ) ;
Original file line number Diff line number Diff line change
1
+ import format from "date-fns/format" ;
2
+
3
+ var span = document . querySelector ( "#time-now" ) ;
4
+
5
+ export default function update ( ) {
6
+ span . textContent = format ( new Date ( ) , "h:mm:ssa" ) ;
7
+ setTimeout ( update , 1000 ) ;
8
+ }
You can’t perform that action at this time.
0 commit comments