Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
play
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
play
Commits
fc1da90c
Commit
fc1da90c
authored
2 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
chore: add JSON import plugin
parent
c0148229
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Local settings via JSON and initial use of Context API
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rollup.config.js
+143
-136
143 additions, 136 deletions
rollup.config.js
with
143 additions
and
136 deletions
rollup.config.js
+
143
−
136
View file @
fc1da90c
import
svelte
from
'
rollup
-
plugin-
svelte
'
;
import
sveltePreprocess
from
'
svelte-preprocess
'
;
import
typescript
from
"
@rollup/plugin-
typescript
"
;
import
commonjs
from
'
@rollup/plugin-
commonjs
'
;
import
resolve
from
'
@rollup/plugin-
node-resolve
'
;
import
livereload
from
'
rollup-plugin-livereload
'
;
import
{
terser
}
from
'
rollup-plugin-
terser
'
;
import
postcss
from
'
rollup-plugin-
postcss
'
;
import
replace
from
'
@
rollup
/
plugin-
replace
'
;
import
pkg
from
"
./package.json
"
;
const
production
=
!
process
.
env
.
ROLLUP_WATCH
;
import
commonjs
from
'
@
rollup
/
plugin-
commonjs
'
import
json
from
'
@rollup/plugin-json
'
import
resolve
from
'
@rollup/plugin-
node-resolve
'
import
replace
from
'
@rollup/plugin-
replace
'
import
typescript
from
'
@rollup/plugin-
typescript
'
import
livereload
from
'
rollup-plugin-livereload
'
import
postcss
from
'
rollup-plugin-
postcss
'
import
svelte
from
'
rollup-plugin-
svelte
'
import
{
terser
}
from
'
rollup
-
plugin-
terser
'
import
sveltePreprocess
from
'
svelte-preprocess
'
import
pkg
from
'
./package.json
'
const
production
=
!
process
.
env
.
ROLLUP_WATCH
function
serve
()
{
let
server
;
function
toExit
()
{
if
(
server
)
server
.
kill
(
0
);
}
return
{
writeBundle
()
{
if
(
server
)
return
;
server
=
require
(
'
child_process
'
).
spawn
(
'
npm
'
,
[
'
run
'
,
'
start
'
,
'
--
'
,
'
--dev
'
],
{
stdio
:
[
'
ignore
'
,
'
inherit
'
,
'
inherit
'
],
shell
:
true
});
process
.
on
(
'
SIGTERM
'
,
toExit
);
process
.
on
(
'
exit
'
,
toExit
);
}
};
let
server
function
toExit
()
{
if
(
server
)
server
.
kill
(
0
)
}
return
{
writeBundle
()
{
if
(
server
)
return
server
=
require
(
'
child_process
'
).
spawn
(
'
npm
'
,
[
'
run
'
,
'
start
'
,
'
--
'
,
'
--dev
'
],
{
stdio
:
[
'
ignore
'
,
'
inherit
'
,
'
inherit
'
],
shell
:
true
,
},
)
process
.
on
(
'
SIGTERM
'
,
toExit
)
process
.
on
(
'
exit
'
,
toExit
)
},
}
}
export
default
{
input
:
'
src/main.ts
'
,
output
:
{
sourcemap
:
true
,
format
:
'
iife
'
,
name
:
'
app
'
,
file
:
'
public/build/aura-player-bundle.js
'
},
plugins
:
[
/** Inject App Version **/
replace
({
preventAssignment
:
true
,
APP_VERSION
:
pkg
.
version
}),
/** Handle HTML5 Web Components **/
svelte
({
include
:
/
\.
wc
\.
svelte$/
,
preprocess
:
sveltePreprocess
({
sourceMap
:
!
production
,
}),
compilerOptions
:
{
// enable run-time checks when not in production
dev
:
!
production
,
customElement
:
true
,
},
// store CSS in JavaScript
emitCss
:
false
}),
/** Handle Svelte Components **/
svelte
({
exclude
:
/
\.
wc
\.
svelte$/
,
preprocess
:
sveltePreprocess
({
sourceMap
:
!
production
,
}),
compilerOptions
:
{
// enable run-time checks when not in production
dev
:
!
production
,
customElement
:
false
,
},
// we'll extract any component CSS out into
// a separate file - better for performance
emitCss
:
true
}),
// we'll extract any component CSS out into
// a separate file - better for performance
// css({ output: 'aura-player-bundle.css' })
/** SASS Support */
postcss
({
extract
:
true
,
minimize
:
production
,
use
:
[
[
'
sass
'
,
{
includePaths
:
[
'
./src
'
,
'
./src/theme
'
,
'
./node_modules
'
],
},
],
],
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve
({
browser
:
true
,
dedupe
:
[
'
svelte
'
]
}),
commonjs
(),
/** TypeScript Support */
typeCheck
(),
typescript
({
rootDir
:
'
./src
'
,
sourceMap
:
!
production
}),
// In dev mode, call `npm run start` once
// the bundle has been generated
!
production
&&
serve
(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!
production
&&
livereload
(
'
public
'
),
// If we're building for production (npm run build
// instead of npm run dev), minify
production
&&
terser
()
],
watch
:
{
clearScreen
:
false
}
};
input
:
'
src/main.ts
'
,
output
:
{
sourcemap
:
true
,
format
:
'
iife
'
,
name
:
'
app
'
,
file
:
'
public/build/aura-player-bundle.js
'
,
},
plugins
:
[
/** Allow import of JSON Files **/
json
({
compact
:
true
,
}),
/** Inject App Version **/
replace
({
preventAssignment
:
true
,
__APP_VERSION__
:
pkg
.
version
,
}),
/** Handle HTML5 Web Components **/
svelte
({
include
:
/
\.
wc
\.
svelte$/
,
preprocess
:
sveltePreprocess
({
sourceMap
:
!
production
,
}),
compilerOptions
:
{
// enable run-time checks when not in production
dev
:
!
production
,
customElement
:
true
,
},
// store CSS in JavaScript
emitCss
:
false
,
}),
/** Handle Svelte Components **/
svelte
({
exclude
:
/
\.
wc
\.
svelte$/
,
preprocess
:
sveltePreprocess
({
sourceMap
:
!
production
,
}),
compilerOptions
:
{
// enable run-time checks when not in production
dev
:
!
production
,
customElement
:
false
,
},
// we'll extract any component CSS out into
// a separate file - better for performance
emitCss
:
true
,
}),
// we'll extract any component CSS out into
// a separate file - better for performance
// css({ output: 'aura-player-bundle.css' })
/** SASS Support */
postcss
({
extract
:
true
,
minimize
:
production
,
use
:
[
[
'
sass
'
,
{
includePaths
:
[
'
./src
'
,
'
./src/theme
'
,
'
./node_modules
'
],
},
],
],
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve
({
browser
:
true
,
dedupe
:
[
'
svelte
'
],
}),
commonjs
(),
/** TypeScript Support */
typeCheck
(),
typescript
({
rootDir
:
'
./src
'
,
sourceMap
:
!
production
}),
// In dev mode, call `npm run start` once
// the bundle has been generated
!
production
&&
serve
(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!
production
&&
livereload
(
'
public
'
),
// If we're building for production (npm run build
// instead of npm run dev), minify
production
&&
terser
(),
],
watch
:
{
clearScreen
:
false
,
},
}
function
typeCheck
()
{
return
{
writeBundle
()
{
require
(
'
child_process
'
).
spawn
(
'
svelte-check
'
,
{
stdio
:
[
'
ignore
'
,
'
inherit
'
,
'
inherit
'
],
shell
:
true
});
}
}
}
\ No newline at end of file
return
{
writeBundle
()
{
require
(
'
child_process
'
).
spawn
(
'
svelte-check
'
,
{
stdio
:
[
'
ignore
'
,
'
inherit
'
,
'
inherit
'
],
shell
:
true
,
})
},
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment