feat(admin, admin-ui, medusa-js, medusa-react, medusa): Support Admin Extensions (#4761)
Co-authored-by: Rares Stefan <948623+StephixOne@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
26c78bbc03
commit
f1a05f4725
42
packages/admin-ui/webpack.config.dev.ts
Normal file
42
packages/admin-ui/webpack.config.dev.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { DuplicateReporterPlugin } from "duplicate-dependencies-webpack-plugin"
|
||||
import path from "path"
|
||||
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"
|
||||
import { Configuration } from "webpack-dev-server"
|
||||
import { getWebpackConfig } from "./src/node/webpack/get-webpack-config"
|
||||
|
||||
const getDevServerConfig = () => {
|
||||
const analyzeBundle = process.env.ANALYZE_BUNDLE
|
||||
const analyzeDuplicateDependencies = process.env.ANALYZE_DEPS
|
||||
|
||||
const devConfig = getWebpackConfig({
|
||||
cacheDir: __dirname,
|
||||
dest: path.resolve(__dirname, "build"),
|
||||
entry: path.resolve(__dirname, "ui", "src", "main.tsx"),
|
||||
env: "development",
|
||||
options: {
|
||||
backend: "http://localhost:9000",
|
||||
path: "/",
|
||||
},
|
||||
template: path.resolve(__dirname, "ui", "index.html"),
|
||||
})
|
||||
|
||||
if (analyzeBundle) {
|
||||
devConfig.plugins?.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
if (analyzeDuplicateDependencies === "true") {
|
||||
devConfig.plugins?.push(new DuplicateReporterPlugin())
|
||||
}
|
||||
|
||||
return {
|
||||
...devConfig,
|
||||
...{
|
||||
devServer: {
|
||||
port: 7001,
|
||||
historyApiFallback: true,
|
||||
} as Configuration,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = getDevServerConfig()
|
||||
Reference in New Issue
Block a user