-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plus other cleanup from review.
- Loading branch information
Showing
6 changed files
with
34 additions
and
65 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
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,28 @@ | ||
export function buildConfig(source, filename) { | ||
return { | ||
build: { | ||
sourcemap: true, | ||
emptyOutDir: false, | ||
lib: { | ||
// Could also be a dictionary or array of multiple entry points | ||
entry: source, | ||
name: 'ScrollTimeline', | ||
// the proper extensions will be added | ||
fileName: (format, entryAlias) => `${filename}${format=='iife'?'':'-' + format}.js`, | ||
formats: ['iife'], | ||
}, | ||
minify: 'terser', | ||
terserOptions: { | ||
keep_classnames: /^((View|Scroll)Timeline)|CSS.*$/ | ||
}, | ||
rollupOptions: { | ||
output: { | ||
// Provide global variables to use in the UMD build | ||
// for externalized deps | ||
globals: { | ||
}, | ||
}, | ||
} | ||
} | ||
}; | ||
} |
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,28 +1,5 @@ | ||
import { resolve } from 'path' | ||
import { defineConfig } from 'vite' | ||
import { buildConfig } from './vite.config.common' | ||
|
||
export default defineConfig({ | ||
build: { | ||
sourcemap: true, | ||
lib: { | ||
// Could also be a dictionary or array of multiple entry points | ||
entry: resolve(__dirname, 'src/index.js'), | ||
name: 'ScrollTimeline', | ||
// the proper extensions will be added | ||
fileName: (format, entryAlias) => `scroll-timeline${format=='iife'?'':'-' + format}.js`, | ||
formats: ['iife'], | ||
}, | ||
minify: 'terser', | ||
terserOptions: { | ||
keep_classnames: /^((View|Scroll)Timeline)|CSS.*$/ | ||
}, | ||
rollupOptions: { | ||
output: { | ||
// Provide global variables to use in the UMD build | ||
// for externalized deps | ||
globals: { | ||
}, | ||
}, | ||
} | ||
}, | ||
}) | ||
export default defineConfig(buildConfig(resolve(__dirname, 'src/index.js'), 'scroll-timeline')); |
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,29 +1,5 @@ | ||
import { resolve } from 'path' | ||
import { defineConfig } from 'vite' | ||
import { buildConfig } from './vite.config.common' | ||
|
||
export default defineConfig({ | ||
build: { | ||
sourcemap: true, | ||
outDir: 'dist-lite', | ||
lib: { | ||
// Could also be a dictionary or array of multiple entry points | ||
entry: resolve(__dirname, 'src/index-lite.js'), | ||
name: 'ScrollTimelineLite', | ||
// the proper extensions will be added | ||
fileName: (format, entryAlias) => `scroll-timeline-lite${format=='iife'?'':'-' + format}.js`, | ||
formats: ['iife'], | ||
}, | ||
minify: 'terser', | ||
terserOptions: { | ||
keep_classnames: /^((View|Scroll)Timeline)|CSS.*$/ | ||
}, | ||
rollupOptions: { | ||
output: { | ||
// Provide global variables to use in the UMD build | ||
// for externalized deps | ||
globals: { | ||
}, | ||
}, | ||
} | ||
}, | ||
}) | ||
export default defineConfig(buildConfig(resolve(__dirname, 'src/index-lite.js'), 'scroll-timeline-lite')); |