diff --git a/.dockerignore b/.dockerignore index 2a4142088908e..20e2758d3dbe6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -78,7 +78,7 @@ cpu.out /public/js /public/css /public/fonts -/public/img/webpack +/public/img/bundled /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* diff --git a/.gitignore b/.gitignore index 6851be742c641..a2a4011ef3d9f 100644 --- a/.gitignore +++ b/.gitignore @@ -75,7 +75,7 @@ cpu.out /public/js /public/css /public/fonts -/public/img/webpack +/public/img/bundled /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* diff --git a/Makefile b/Makefile index 7de96f09fdd18..022344d28fa90 100644 --- a/Makefile +++ b/Makefile @@ -114,10 +114,10 @@ GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/m FOMANTIC_WORK_DIR := web_src/fomantic -WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f) -WEBPACK_CONFIGS := webpack.config.js -WEBPACK_DEST := public/js/index.js public/css/index.css -WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack +VITE_SOURCES := $(shell find web_src/js web_src/css -type f) +VITE_CONFIGS := vite.config.js +VITE_DEST := public/js/index.js public/css/index.css +VITE_DEST_ENTRIES := public/js public/css public/fonts public/img/bundled BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST)) @@ -228,7 +228,7 @@ help: @echo " - test-e2e[\#TestSpecificName] test end to end using playwright" @echo " - update-js update js dependencies" @echo " - update-py update py dependencies" - @echo " - webpack build webpack files" + @echo " - vite build vite files" @echo " - svg build svg files" @echo " - fomantic build fomantic files" @echo " - generate run \"go generate\"" @@ -273,7 +273,7 @@ node-check: .PHONY: clean-all clean-all: clean - rm -rf $(WEBPACK_DEST_ENTRIES) node_modules + rm -rf $(VITE_DEST_ENTRIES) node_modules .PHONY: clean clean: @@ -434,8 +434,8 @@ watch: .PHONY: watch-frontend watch-frontend: node-check node_modules - @rm -rf $(WEBPACK_DEST_ENTRIES) - NODE_ENV=development npx webpack --watch --progress + @rm -rf $(VITE_DEST_ENTRIES) + NODE_ENV=development npx vite build --watch .PHONY: watch-backend watch-backend: go-check @@ -806,7 +806,7 @@ install: $(wildcard *.go) build: frontend backend .PHONY: frontend -frontend: $(WEBPACK_DEST) +frontend: $(VITE_DEST) .PHONY: backend backend: go-check generate-backend $(EXECUTABLE) @@ -952,14 +952,14 @@ fomantic: $(SED_INPLACE) -e 's/\r//g' $(FOMANTIC_WORK_DIR)/build/semantic.css $(FOMANTIC_WORK_DIR)/build/semantic.js rm -f $(FOMANTIC_WORK_DIR)/build/*.min.* -.PHONY: webpack -webpack: $(WEBPACK_DEST) +.PHONY: vite +vite: $(VITE_DEST) -$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json +$(VITE_DEST): $(VITE_SOURCES) $(VITE_CONFIGS) package-lock.json @$(MAKE) -s node-check node_modules - rm -rf $(WEBPACK_DEST_ENTRIES) - npx webpack - @touch $(WEBPACK_DEST) + rm -rf $(VITE_DEST_ENTRIES) + npx vite build + @touch $(VITE_DEST) .PHONY: svg svg: node-check | node_modules diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md index 98179dd55e0e1..2a76bc1cacbc6 100644 --- a/docs/content/doc/installation/from-source.en-us.md +++ b/docs/content/doc/installation/from-source.en-us.md @@ -132,7 +132,7 @@ If pre-built frontend files are present it is possible to only build the backend TAGS="bindata" make backend ``` -Webpack source maps are by default enabled in development builds and disabled in production builds. They can be enabled by setting the `ENABLE_SOURCEMAP=true` environment variable. +Webpack source maps are by default enabled in development builds and disabled in production builds. They can be enabled by setting the `VITE_ENABLE_SOURCEMAP=true` environment variable. ## Test diff --git a/package-lock.json b/package-lock.json index 92e4087b08495..0bd4f329bd244 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@github/text-expander-element": "2.5.0", "@mcaptcha/vanilla-glue": "0.1.0-alpha-3", "@primer/octicons": "19.4.0", + "@vitejs/plugin-vue": "4.2.3", "@webcomponents/custom-elements": "1.6.0", "add-asset-webpack-plugin": "2.0.1", "ansi_up": "5.2.1", @@ -38,6 +39,7 @@ "monaco-editor-webpack-plugin": "7.0.1", "pdfobject": "2.2.12", "pretty-ms": "8.0.0", + "rollup-plugin-license": "3.0.1", "sortablejs": "1.15.0", "swagger-ui-dist": "5.1.0", "throttle-debounce": "5.0.0", @@ -46,6 +48,7 @@ "toastify-js": "1.12.0", "tributejs": "5.1.3", "uint8-to-base64": "0.2.0", + "vite": "4.4.3", "vue": "3.3.4", "vue-bar-graph": "2.0.0", "vue-loader": "17.2.2", @@ -58,7 +61,6 @@ "@eslint-community/eslint-plugin-eslint-comments": "3.2.1", "@playwright/test": "1.35.1", "@stoplight/spectral-cli": "6.8.0", - "@vitejs/plugin-vue": "4.2.3", "eslint": "8.44.0", "eslint-plugin-array-func": "3.1.8", "eslint-plugin-custom-elements": "0.0.8", @@ -1921,7 +1923,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz", "integrity": "sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==", - "dev": true, "engines": { "node": "^14.18.0 || >=16.0.0" }, @@ -3150,6 +3151,11 @@ "node": ">= 12.0.0" } }, + "node_modules/commenting": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/commenting/-/commenting-1.1.0.tgz", + "integrity": "sha512-YeNK4tavZwtH7jEgK1ZINXzLKm6DZdEMfsaaieOsCAN0S8vsY7UeuO3Q7d/M018EFgE+IeUAuBOKkFccBZsUZA==" + }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -5247,7 +5253,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -7890,6 +7895,17 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/mlly": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.0.tgz", @@ -7902,6 +7918,14 @@ "ufo": "^1.1.2" } }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "engines": { + "node": "*" + } + }, "node_modules/monaco-editor": { "version": "0.40.0", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.40.0.tgz", @@ -8289,6 +8313,17 @@ "node": ">= 8" } }, + "node_modules/package-name-regex": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/package-name-regex/-/package-name-regex-2.0.6.tgz", + "integrity": "sha512-gFL35q7kbE/zBaPA3UKhp2vSzcPYx2ecbYuwv1ucE9Il6IIgBDweBlH8D68UFGZic2MkllKa2KHCfC1IQBQUYA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/dword-design" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -9234,7 +9269,6 @@ "version": "2.79.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", - "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -9245,6 +9279,39 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-3.0.1.tgz", + "integrity": "sha512-/lec6Y94Y3wMfTDeYTO/jSXII0GQ/XkDZCiqkMKxyU5D5nGPaxr/2JNYvAgYsoCYuOLGOanKDPjCCQiTT96p7A==", + "dependencies": { + "commenting": "~1.1.0", + "glob": "~7.2.0", + "lodash": "~4.17.21", + "magic-string": "~0.26.2", + "mkdirp": "~1.0.4", + "moment": "~2.29.3", + "package-name-regex": "~2.0.6", + "spdx-expression-validate": "~2.0.0", + "spdx-satisfies": "~5.0.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.0.0 || ^2.0.0 || ^3.0.0" + } + }, + "node_modules/rollup-plugin-license/node_modules/magic-string": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", + "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "dependencies": { + "sourcemap-codec": "^1.4.8" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", @@ -9651,8 +9718,7 @@ "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "deprecated": "Please use @jridgewell/sourcemap-codec instead", - "dev": true + "deprecated": "Please use @jridgewell/sourcemap-codec instead" }, "node_modules/spdx-compare": { "version": "1.0.0", @@ -10648,13 +10714,12 @@ } }, "node_modules/vite": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.2.tgz", - "integrity": "sha512-zUcsJN+UvdSyHhYa277UHhiJ3iq4hUBwHavOpsNUGsTgjBeoBlK8eDt+iT09pBq0h9/knhG/SPrZiM7cGmg7NA==", - "dev": true, + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.3.tgz", + "integrity": "sha512-IMnXQXXWgLi5brBQx/4WzDxdzW0X3pjO4nqFJAuNvwKtxzAmPzFE1wszW3VDpAGQJm3RZkm/brzRdyGsnwgJIA==", "dependencies": { "esbuild": "^0.18.10", - "postcss": "^8.4.24", + "postcss": "^8.4.25", "rollup": "^3.25.2" }, "bin": { @@ -10741,7 +10806,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" @@ -10757,7 +10821,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" @@ -10773,7 +10836,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" @@ -10789,7 +10851,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -10805,7 +10866,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -10821,7 +10881,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -10837,7 +10896,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -10853,7 +10911,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10869,7 +10926,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10885,7 +10941,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10901,7 +10956,6 @@ "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10917,7 +10971,6 @@ "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10933,7 +10986,6 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10949,7 +11001,6 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10965,7 +11016,6 @@ "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10981,7 +11031,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -10997,7 +11046,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" @@ -11013,7 +11061,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" @@ -11029,7 +11076,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" @@ -11045,7 +11091,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -11061,7 +11106,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -11077,7 +11121,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -11090,7 +11133,6 @@ "version": "0.18.11", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.11.tgz", "integrity": "sha512-i8u6mQF0JKJUlGR3OdFLKldJQMMs8OqM9Cc3UCi9XXziJ9WERM5bfkHaEAy0YAvPRMgqSW55W7xYn84XtEFTtA==", - "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -11127,7 +11169,6 @@ "version": "3.26.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.2.tgz", "integrity": "sha512-6umBIGVz93er97pMgQO08LuH3m6PUb3jlDUUGFsNJB6VgTCUaDFpupf5JfU30529m/UKOgmiX+uY6Sx8cOYpLA==", - "dev": true, "bin": { "rollup": "dist/bin/rollup" }, diff --git a/package.json b/package.json index 10956595b6891..1e1b417543a4d 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@github/text-expander-element": "2.5.0", "@mcaptcha/vanilla-glue": "0.1.0-alpha-3", "@primer/octicons": "19.4.0", + "@vitejs/plugin-vue": "4.2.3", "@webcomponents/custom-elements": "1.6.0", "add-asset-webpack-plugin": "2.0.1", "ansi_up": "5.2.1", @@ -37,6 +38,7 @@ "monaco-editor-webpack-plugin": "7.0.1", "pdfobject": "2.2.12", "pretty-ms": "8.0.0", + "rollup-plugin-license": "3.0.1", "sortablejs": "1.15.0", "swagger-ui-dist": "5.1.0", "throttle-debounce": "5.0.0", @@ -45,6 +47,7 @@ "toastify-js": "1.12.0", "tributejs": "5.1.3", "uint8-to-base64": "0.2.0", + "vite": "4.4.3", "vue": "3.3.4", "vue-bar-graph": "2.0.0", "vue-loader": "17.2.2", @@ -57,7 +60,6 @@ "@eslint-community/eslint-plugin-eslint-comments": "3.2.1", "@playwright/test": "1.35.1", "@stoplight/spectral-cli": "6.8.0", - "@vitejs/plugin-vue": "4.2.3", "eslint": "8.44.0", "eslint-plugin-array-func": "3.1.8", "eslint-plugin-custom-elements": "0.0.8", diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000000000..047051b689446 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,130 @@ +import {defineConfig, loadEnv} from 'vite'; +import {fileURLToPath} from 'node:url'; +import {parse, dirname, extname} from 'node:path'; +import {rmSync, mkdirSync, readFileSync} from 'node:fs'; +import {stringPlugin} from 'vite-string-plugin'; +import wrapAnsi from 'wrap-ansi'; +import fastGlob from 'fast-glob'; +import vue from '@vitejs/plugin-vue'; +import licensePlugin from 'rollup-plugin-license'; + +const glob = (pattern) => fastGlob.sync(pattern, { + cwd: dirname(fileURLToPath(new URL(import.meta.url))), + absolute: true, +}); + +function formatLicenseText(licenseText) { + return wrapAnsi(licenseText || '', 80).trim(); +} + +function cleanOutDirPlugin() { + return { + name: 'vite-clean-out-dir-plugin', + buildStart: () => { + rmSync(new URL('public/js', import.meta.url), {recursive: true, force: true}); + rmSync(new URL('public/css', import.meta.url), {recursive: true, force: true}); + rmSync(new URL('public/fonts', import.meta.url), {recursive: true, force: true}); + mkdirSync(new URL('public/js', import.meta.url), {recursive: true}); + mkdirSync(new URL('public/css', import.meta.url), {recursive: true}); + mkdirSync(new URL('public/fonts', import.meta.url), {recursive: true}); + } + }; +} + +export default defineConfig(({mode}) => { + const envDir = fileURLToPath(new URL(dirname(import.meta.url))); + const env = loadEnv(mode, envDir); + const isProduction = mode !== 'development'; + + const themes = {}; + for (const path of glob('web_src/css/themes/*.css')) { + themes[parse(path).name] = path; + } + + let sourceMapEnabled; + if ('VITE_ENABLE_SOURCEMAP' in env) { + sourceMapEnabled = env.VITE_ENABLE_SOURCEMAP === 'true'; + } else { + sourceMapEnabled = !isProduction; + } + + return { + root: fileURLToPath(new URL('.', import.meta.url)), + base: '/', + publicDir: false, + logLevel: 'info', + clearScreen: false, + open: false, + envDir, + build: { + outDir: fileURLToPath(new URL('public', import.meta.url)), + emptyOutDir: false, + rollupOptions: { + input: { + index: fileURLToPath(new URL('web_src/js/entry/index.js', import.meta.url)), + webcomponents: fileURLToPath(new URL('web_src/js/entry/webcomponents.js', import.meta.url)), + swagger: fileURLToPath(new URL('web_src/js/entry/swagger.js', import.meta.url)), + 'eventsource.sharedworker': fileURLToPath(new URL('web_src/js/entry/eventsource.sharedworker.js', import.meta.url)), + ...(!isProduction && { + devtest: fileURLToPath(new URL('web_src/js/entry/devtest.js', import.meta.url)), + }), + ...themes, + }, + output: { + entryFileNames: 'js/[name].js', + chunkFileNames: 'js/[name].[hash:8].js', + assetFileNames: ({name}) => { + name = name.split('?')[0]; + if (name === 'index.css') return `css/${name}`; + if (name.startsWith('theme')) return `css/${name}`; + if (/\.js$/i.test(name)) return `css/[name].[hash:8].js`; + if (/\.css$/i.test(name)) return `css/[name].[hash:8].css`; + if (/\.(ttf|woff2?)$/i.test(name)) return `fonts/[name].[hash:8]${extname(name)}`; + if (/\.png$/i.test(name)) return `img/bundled/[name].[hash:8]${extname(name)}`; + if (name === 'editor.main') return 'js/[name].[hash:8].js'; + throw new Error(`Unable to match asset ${name} to path, please add it in vite.config.js`); + }, + }, + }, + minify: false, + target: 'modules', + chunkSizeWarningLimit: Infinity, + assetsInlineLimit: 32768, + reportCompressedSize: false, + sourcemap: sourceMapEnabled, + }, + css: { + transformer: 'lightningcss', + }, + esbuild: { + legalComments: 'none', + }, + plugins: [ + cleanOutDirPlugin(), + stringPlugin(), + vue(), + licensePlugin({ + thirdParty: { + output: { + file: fileURLToPath(new URL('public/js/licenses.txt', import.meta.url)), + template(dependencies) { + const line = '-'.repeat(80); + const goJson = readFileSync('assets/go-licenses.json', 'utf8'); + const goModules = JSON.parse(goJson).map(({name, licenseText}) => { + return {name, body: formatLicenseText(licenseText)}; + }); + const jsModules = dependencies.map(({name, version, licenseName, licenseText}) => { + return {name, version, licenseName, body: formatLicenseText(licenseText)}; + }); + + const modules = [...goModules, ...jsModules].sort((a, b) => a.name.localeCompare(b.name)); + return modules.map(({name, version, body}) => { + return `${line}\n${name}@${version}\n${line}\n${body}`; + }).join('\n'); + }, + }, + }, + }), + ], + }; +}); diff --git a/web_src/js/entry/devtest.js b/web_src/js/entry/devtest.js new file mode 100644 index 0000000000000..eec7b3cf0872c --- /dev/null +++ b/web_src/js/entry/devtest.js @@ -0,0 +1,2 @@ +import '../standalone/devtest.js'; +import '../../css/standalone/devtest.css'; diff --git a/web_src/js/entry/eventsource.sharedworker.js b/web_src/js/entry/eventsource.sharedworker.js new file mode 100644 index 0000000000000..c6bd7894744c9 --- /dev/null +++ b/web_src/js/entry/eventsource.sharedworker.js @@ -0,0 +1 @@ +import '../features/eventsource.sharedworker.js'; diff --git a/web_src/js/entry/index.js b/web_src/js/entry/index.js new file mode 100644 index 0000000000000..6bed1303a2ae3 --- /dev/null +++ b/web_src/js/entry/index.js @@ -0,0 +1,6 @@ +import '../jquery.js'; +import '../../fomantic/build/semantic.js'; +import '../index.js'; +import 'easymde/dist/easymde.min.css'; +import '../../fomantic/build/semantic.css'; +import '../../css/index.css'; diff --git a/web_src/js/entry/swagger.js b/web_src/js/entry/swagger.js new file mode 100644 index 0000000000000..5b17717c091c5 --- /dev/null +++ b/web_src/js/entry/swagger.js @@ -0,0 +1,2 @@ +import '../standalone/swagger.js'; +import '../../css/standalone/swagger.css'; diff --git a/web_src/js/webcomponents/webcomponents.js b/web_src/js/entry/webcomponents.js similarity index 73% rename from web_src/js/webcomponents/webcomponents.js rename to web_src/js/entry/webcomponents.js index 123607282bc78..21340c43fec34 100644 --- a/web_src/js/webcomponents/webcomponents.js +++ b/web_src/js/entry/webcomponents.js @@ -1,3 +1,3 @@ import '@webcomponents/custom-elements'; // polyfill for some browsers like Pale Moon import '@github/relative-time-element'; -import './GiteaOriginUrl.js'; +import '../webcomponents/GiteaOriginUrl.js';