Skip to content

Commit

Permalink
feat(front): add non-min and min bundle to build
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Oct 17, 2024
1 parent 4dfd344 commit 2048aac
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 85 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"./packages/*"
],
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
"@types/node": "latest",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
Expand Down
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"access": "public"
},
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
"@thatopen/fragments": ">=2.4.0-alpha.1",
"@thatopen/ui": "~2.3.0",
"@types/three": "0.160.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/front/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components-front",
"description": "Collection of frontend tools to author BIM apps.",
"version": "2.4.0-alpha.4",
"version": "2.4.0-alpha.5",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
29 changes: 21 additions & 8 deletions packages/front/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import dts from "vite-plugin-dts";
import { defineConfig } from "vite";
import * as path from "path";
import * as fs from "fs";
import pluginTerser from "@rollup/plugin-terser";
import * as packageJson from "./package.json";

const clonePackageJSON = () => {
Expand Down Expand Up @@ -38,18 +39,30 @@ export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, "./src/index.ts"),
formats: ["es"],
fileName: "index",
},
rollupOptions: {
external: Object.keys(packageJson.peerDependencies),
output: {
globals: {
three: "THREE",
"@thatopen/fragments": "FRAGS",
"web-ifc": "WEB-IFC",
output: [
{
entryFileNames: `index.js`,
format: "es",
globals: {
three: "THREE",
"@thatopen/fragments": "FRAGS",
"web-ifc": "WEB-IFC",
},
},
},
{
entryFileNames: `index.min.js`,
plugins: [pluginTerser()],
format: "es",
globals: {
three: "THREE",
"@thatopen/fragments": "FRAGS",
"web-ifc": "WEB-IFC",
},
},
],
},
},
plugins: [
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@thatopen/components@workspace:packages/core"
dependencies:
"@rollup/plugin-terser": ^0.4.4
"@thatopen/fragments": ">=2.4.0-alpha.1"
"@thatopen/ui": ~2.3.0
"@types/three": 0.160.0
Expand Down Expand Up @@ -3808,6 +3807,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "root-workspace-0b6124@workspace:."
dependencies:
"@rollup/plugin-terser": ^0.4.4
"@types/node": latest
"@typescript-eslint/eslint-plugin": 7.2.0
"@typescript-eslint/parser": 7.2.0
Expand Down

0 comments on commit 2048aac

Please sign in to comment.