Skip to content

Commit 6b89fa1

Browse files
authored
chore: cleanup build configuration (#185)
* chore: cleanup build configuration * chore: remove unused dependency
1 parent 4ab9b17 commit 6b89fa1

File tree

7 files changed

+44
-26
lines changed

7 files changed

+44
-26
lines changed

package-lock.json

Lines changed: 20 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44
"description": "Bootstrap theme for Oruga",
55
"license": "MIT",
66
"type": "module",
7-
"main": "dist/bootstrap.cjs",
8-
"module": "dist/bootstrap.js",
9-
"unpkg": "dist/bootstrap.cjs",
7+
"main": "dist/theme.umd.cjs",
8+
"module": "dist/theme.js",
9+
"unpkg": "dist/theme.umd.cjs",
1010
"types": "dist/types/theme.d.ts",
1111
"sideEffects": [
1212
"*.css",
1313
"*.scss"
1414
],
15+
"exports": {
16+
".": {
17+
"import": "./dist/theme.js"
18+
},
19+
"./style.css": "./dist/theme.css",
20+
"./style.scss": "./dist/scss/theme.scss"
21+
},
1522
"files": [
1623
"dist"
1724
],
@@ -62,7 +69,6 @@
6269
"sass": "1.93.2",
6370
"stylelint": "^16.25.0",
6471
"stylelint-config-recommended-scss": "^16.0.2",
65-
"terser": "^5.44.0",
6672
"typescript": "5.9.3",
6773
"vite": "7.1.10",
6874
"vite-plugin-banner": "^0.8.1",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*************************************
2-
* Oruga Theme Boostrap Full Build
3-
**************************************/
1+
/**********************
2+
* Theme Full Build
3+
***********************/
44

55
// import bootstrap functions first (so you can manipulate colors, SVGs, calc, etc)
66
@import "bootstrap/scss/functions";
@@ -15,5 +15,5 @@
1515
// import bootstrap styles
1616
@import "bootstrap/scss/bootstrap";
1717

18-
// import oruga theme styles
18+
// import theme styles
1919
@import "./bootstrap";
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/**************************
2-
* Oruga Theme Boostrap
3-
***************************/
1+
/******************
2+
* Theme Styles
3+
*******************/
44

5-
// Globals, utility and functions
5+
// import globals, utilities and functions
66
@import "utils/animations";
77
@import "utils/functions";
88
@import "utils/utility";
99
@import "utils/root";
1010
@import "utils/base";
1111

12-
// Oruga components
12+
// import theme components
1313
@import "components/autocomplete";
1414
@import "components/breadcrumb";
1515
@import "components/button";

src/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file is intended to the be the main entrypoint for the theme's rollup build.
1+
// This file is intended to the be the main entrypoint for the theme's build.
22

3-
import "./assets/scss/bootstrap-build.scss";
3+
import "./assets/scss/theme-build.scss";
44
export * from "./plugins/theme.ts";

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import "@oruga-ui/examples/dist/examples.css";
1313
import { bootstrapConfig } from "./plugins/theme";
1414

1515
// add theme styles
16-
import "./assets/scss/bootstrap-build.scss";
16+
import "./assets/scss/theme-build.scss";
1717

1818
createApp(App)
1919
.use(router)

vite.config.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,17 @@ export default defineConfig(({ mode }) => {
5353
build: {
5454
emptyOutDir: true,
5555
copyPublicDir: false,
56-
minify: "terser",
5756
lib: {
5857
entry: resolve(__dirname, "src/build.ts"),
5958
name: "OrugaThemeBootstrap",
60-
fileName: "bootstrap",
61-
formats: ["es", "cjs", "umd"],
59+
fileName: "theme",
60+
cssFileName: "theme",
6261
},
6362
rollupOptions: {
6463
// make sure to externalize deps that shouldn't be bundled
6564
// into your library
6665
external: ["vue", /oruga\/.*/],
6766
output: {
68-
assetFileNames: "bootstrap.[ext]",
6967
// Provide global variables to use in the UMD build
7068
// for externalized deps
7169
globals: {
@@ -75,14 +73,11 @@ export default defineConfig(({ mode }) => {
7573
},
7674
},
7775
css: {
78-
// rename default `style.css` to `bootstrap.css`
79-
postcss: { to: "bootstrap.css" },
8076
preprocessorOptions: {
8177
includePaths: ["node_modules"],
8278
scss: {
8379
// this can be removed with bootstrap 5.4 (https://github.com/twbs/bootstrap/issues/40962)
8480
silenceDeprecations: [
85-
"mixed-decls",
8681
"color-functions",
8782
"global-builtin",
8883
"import",

0 commit comments

Comments
 (0)