Skip to content

Commit

Permalink
Revert "feat: 1. absolute path 2.build entryFileNames index 3.add hea…
Browse files Browse the repository at this point in the history
…dless script name buyerPortal"

This reverts commit 7ad0008.
  • Loading branch information
CarlLiu2023 committed Sep 8, 2023
1 parent cc8acb7 commit b0d751c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 125 deletions.
81 changes: 0 additions & 81 deletions apps/storefront/src/buyerPortal.ts

This file was deleted.

44 changes: 0 additions & 44 deletions apps/storefront/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ import path from 'path' // eslint-disable-line
import { visualizer } from 'rollup-plugin-visualizer'
import { defineConfig, loadEnv } from 'vite'

interface AssetsAbsolutePathProps {
[key: string]: string
}

const assetsAbsolutePath: AssetsAbsolutePathProps = {
staging: 'https://cdn.bundleb2b.net/b2b/staging/storefront/assets/',
production: 'https://cdn.bundleb2b.net/b2b/production/storefront/assets/',
}

export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
return {
Expand All @@ -24,23 +15,6 @@ export default defineConfig(({ mode }) => {
}),
react(),
],
experimental: {
renderBuiltUrl(
filename: string,
{
type,
}: {
type: 'public' | 'asset'
}
) {
if (type === 'asset') {
const name = filename.split('assets/')[1]
return `${assetsAbsolutePath[mode]}${name}`
}

return undefined
},
},
server: {
port: 3001,
proxy: {
Expand All @@ -64,24 +38,6 @@ export default defineConfig(({ mode }) => {
build: {
minify: true,
rollupOptions: {
input: {
index: 'src/main.ts',
buyerPortal: 'src/buyerPortal.ts',
},
output: {
entryFileNames(info) {
const { name } = info
return name.includes('buyerPortal')
? '[name].js'
: '[name].[hash].js'
},
},
onwarn(warning, warn) {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
return
}
warn(warning)
},
manualChunks: {
intl: ['react-intl'],
redux: ['react-redux'],
Expand Down

0 comments on commit b0d751c

Please sign in to comment.