mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 07:40:26 -08:00
add minified shaders
This commit is contained in:
2
.github/workflows/npm-publish.yml
vendored
2
.github/workflows/npm-publish.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
||||
npm install
|
||||
- name: "Build Aladin Lite"
|
||||
run: |
|
||||
npm run build
|
||||
npm run build:prod
|
||||
- name: "Publish Aladin Lite to npm"
|
||||
run: |
|
||||
npm publish
|
||||
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -15,9 +15,11 @@ package-lock.json
|
||||
src/core/Cargo.lock
|
||||
src/core/target/
|
||||
|
||||
# this rust file is generated when compiling the code, so it is not
|
||||
# useful to put it on git
|
||||
src/core/src/shaders.rs
|
||||
# the tmp glsl files used when minifying the shaders into the wasm (build.rs)
|
||||
src/glsl/webgl2/**/*.min
|
||||
src/glsl/webgl2/**/*.tmp
|
||||
|
||||
package/
|
||||
|
||||
## python related
|
||||
# python environment
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
let aladin;
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: "data/hips/CDS_P_DSS2_color", target: "05 40 59.12 -02 27 04.1", fov: 2, log: false});
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: "https://cds.unistra.fr/~boch/bug-al-om-change-relative-url/CDS_P_GALEXGR6_7_FUV", target: "05 40 59.12 -02 27 04.1", fov: 2, log: false});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"HiPS"
|
||||
],
|
||||
"scripts": {
|
||||
"wasm:prod": "wasm-pack build ./src/core --target web --release --out-name core -- --features \"webgl2 minify_shaders\" && wasm-opt -Oz --strip-debug --strip-producers --dce -o src/core/pkg/core_bg.wasm src/core/pkg/core_bg.wasm",
|
||||
"wasm:prod": "wasm-pack build ./src/core --target web --release --out-name core -- --features webgl2 && wasm-opt -Oz --strip-debug --strip-producers --dce -o src/core/pkg/core_bg.wasm src/core/pkg/core_bg.wasm",
|
||||
"wasm:dev": "wasm-pack build ./src/core --target web --release --out-name core -- --features webgl2",
|
||||
"wasm:dbg": "wasm-pack build --dev ./src/core --target web --out-name core -- --features=webgl2,dbg",
|
||||
"predeploy": "npm run build:prod && rm -rf aladin-lite*.tgz && npm pack",
|
||||
@@ -47,7 +47,8 @@
|
||||
"test:playwright": "npx playwright test",
|
||||
"test:update-snapshots": "npx playwright test --update-snapshots",
|
||||
"doc": "jsdoc -c jsdoc.json src/js src/js/shapes src/js/libs/astro && cp aladin-logo.png docs/ && cp jsdoc-custom-style.css docs/ && cp jsdoc-make-responsive.js docs/",
|
||||
"doc:dev": "npm run doc && open docs/index.html"
|
||||
"doc:dev": "npm run doc && open docs/index.html",
|
||||
"analyze": "vite build --mode analyze"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.47.0",
|
||||
|
||||
7903
src/core/src/shaders.rs
Normal file
7903
src/core/src/shaders.rs
Normal file
File diff suppressed because it is too large
Load Diff
109
vite.config.ts
109
vite.config.ts
@@ -7,66 +7,61 @@ import wasm from "vite-plugin-wasm";
|
||||
import topLevelAwait from "vite-plugin-top-level-await";
|
||||
// For wasm generated by wasm-pack
|
||||
import wasmPack from 'vite-plugin-wasm-pack';
|
||||
// To include and minify glsl into the bundle
|
||||
//import glsl from 'vite-plugin-glsl';
|
||||
// To include css into the bundle
|
||||
//import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
|
||||
//import fs from 'fs';
|
||||
|
||||
import { visualizer } from "rollup-plugin-visualizer";
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
minify: 'esbuild',
|
||||
lib: {
|
||||
// Could also be a dictionary or array of multiple entry points
|
||||
entry: resolve(__dirname, 'src/js/A.js'),
|
||||
name: 'A',
|
||||
formats: ["umd", "es"],
|
||||
// the proper extensions will be added
|
||||
fileName: 'aladin',
|
||||
export default defineConfig(({mode}) => {
|
||||
return {
|
||||
build: {
|
||||
minify: 'esbuild',
|
||||
lib: {
|
||||
// Could also be a dictionary or array of multiple entry points
|
||||
entry: resolve(__dirname, 'src/js/A.js'),
|
||||
name: 'A',
|
||||
formats: ["umd", "es"],
|
||||
// the proper extensions will be added
|
||||
fileName: 'aladin',
|
||||
},
|
||||
rollupOptions: {},
|
||||
//formats: ["es"],
|
||||
target: ["es2015", "chrome58", "edge18", "firefox57", "node12", "safari11"],
|
||||
//target: ["es2015"],
|
||||
// Relative to the root
|
||||
outDir: resolve(__dirname, 'dist'),
|
||||
},
|
||||
rollupOptions: {},
|
||||
//formats: ["es"],
|
||||
target: ["es2015", "chrome58", "edge18", "firefox57", "node12", "safari11"],
|
||||
//target: ["es2015"],
|
||||
// Relative to the root
|
||||
outDir: resolve(__dirname, 'dist'),
|
||||
},
|
||||
//publicDir: resolve(__dirname, 'src/img'),
|
||||
plugins: [
|
||||
wasm(),
|
||||
wasmPack(resolve(__dirname, 'src/core')),
|
||||
topLevelAwait(),
|
||||
/*glsl({
|
||||
minify: true
|
||||
}),*/
|
||||
/*visualizer({
|
||||
filename: 'stats.html', // output file
|
||||
template: 'treemap', // "sunburst", "treemap", "network"
|
||||
gzipSize: true, // show gzip sizes
|
||||
brotliSize: true, // show brotli sizes
|
||||
open: true // open stats.html automatically
|
||||
}),*/
|
||||
],
|
||||
resolve: {
|
||||
alias: [
|
||||
{find: '@', replacement: path.resolve(__dirname, '/src')},
|
||||
{find: '#', replacement: path.resolve(__dirname, '/tests/unit')},
|
||||
{find: '$', replacement: path.resolve(__dirname, '/tests/e2e')}
|
||||
//publicDir: resolve(__dirname, 'src/img'),
|
||||
plugins: [
|
||||
wasm(),
|
||||
wasmPack(resolve(__dirname, 'src/core')),
|
||||
topLevelAwait(),
|
||||
mode === 'analyze' &&
|
||||
visualizer({
|
||||
filename: 'stats.html', // output file
|
||||
template: 'treemap', // "sunburst", "treemap", "network"
|
||||
gzipSize: true, // show gzip sizes
|
||||
brotliSize: true, // show brotli sizes
|
||||
open: true // open stats.html automatically
|
||||
}),
|
||||
],
|
||||
},
|
||||
//test: {
|
||||
// globals: true,
|
||||
// environment: 'happy-dom',
|
||||
// include: [
|
||||
// 'tests/unit/**/*.{test,spec}.{js,ts}'
|
||||
// ],
|
||||
// deps: {
|
||||
// inline: ['core/pkg'],
|
||||
// },
|
||||
//},
|
||||
server: {
|
||||
open: '/examples/index.html',
|
||||
},
|
||||
resolve: {
|
||||
alias: [
|
||||
{find: '@', replacement: path.resolve(__dirname, '/src')},
|
||||
{find: '#', replacement: path.resolve(__dirname, '/tests/unit')},
|
||||
{find: '$', replacement: path.resolve(__dirname, '/tests/e2e')}
|
||||
],
|
||||
},
|
||||
//test: {
|
||||
// globals: true,
|
||||
// environment: 'happy-dom',
|
||||
// include: [
|
||||
// 'tests/unit/**/*.{test,spec}.{js,ts}'
|
||||
// ],
|
||||
// deps: {
|
||||
// inline: ['core/pkg'],
|
||||
// },
|
||||
//},
|
||||
server: {
|
||||
open: '/examples/index.html',
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user