Commit 100ebea6 authored by 张烨's avatar 张烨

feat: 二级路由打包部署

parent c3ff8b48
PROXY=http://192.168.19.102:8005/
HOST=localhost
PORT=3001
\ No newline at end of file
# PUBLIC_PATH = reactOMS
PROXY = http://192.168.19.102:8005/
HOST = localhost
PORT = 3001
\ No newline at end of file
......@@ -7,7 +7,7 @@ module.exports = options => ({
output: Object.assign(
{
path: path.resolve(process.cwd(), 'build'),
publicPath: '/',
publicPath: process.env.PUBLIC_PATH || '/reactOMS',
},
options.output,
), // Merge with env dependent settings
......
......@@ -18,8 +18,8 @@ module.exports = require('./webpack.base.babel')({
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output: {
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].chunk.js',
filename: 'static/[name].[chunkhash].js',
chunkFilename: 'static/[name].[chunkhash].chunk.js',
},
optimization: {
......
......@@ -12,7 +12,7 @@ export default function App() {
<Helmet titleTemplate="%s - 运维平台" defaultTitle="运维平台">
<meta name="description" content="运维平台" />
</Helmet>
<Router>
<Router basename={process.env.PUBLIC_PATH || 'reactOMS'}>
<Switch>{renderRoutes(config.routes)}</Switch>
</Router>
</>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment