-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
d0740d5
commit b364da9
Showing
6 changed files
with
52 additions
and
52 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,35 +1,11 @@ | ||
/// <reference path="../../../typedef.js" /> | ||
|
||
import svelte from 'rollup-plugin-svelte-hot' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import { terser } from 'rollup-plugin-terser' | ||
import Hmr from 'rollup-plugin-hot' | ||
import livereload from 'rollup-plugin-livereload' | ||
const { keysAsFunctions } = require('../../utils') | ||
|
||
/**@param {RoxiApp} app */ | ||
export default function rollupConfig(app, params, ctx) { | ||
const { pluginsCfg } = app.config.rollup | ||
const { distDir, bundler } = app.config.roxi //todo no longer valid | ||
const { production } = app.state | ||
const isNollup = bundler === 'nollup' | ||
delete app.config.rollup.pluginsCfg | ||
|
||
app.merge({ | ||
config: { | ||
rollup: { | ||
plugins: [ | ||
pluginsCfg.mainJsTransform, | ||
svelte(app.config.svelte), | ||
|
||
// resolve matching modules from current working directory | ||
resolve(pluginsCfg.resolve), | ||
commonjs(), | ||
production && terser(), // minify | ||
// !production && isNollup && Hmr(pluginsCfg.hmr), // refresh only updated code | ||
!production && !isNollup && livereload(distDir), // refresh entire window when code is updated | ||
] | ||
} | ||
} | ||
}) | ||
export default async function rollupConfig(app, params, ctx) { | ||
const { plugins, pluginsMap } = app.config.rollup | ||
delete app.config.rollup.pluginsMap | ||
app.config.rollup.plugins.svelte = app.config.svelte | ||
app.config.rollup.plugins = await keysAsFunctions(plugins, pluginsMap) | ||
} |
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