Commit 215a01cb authored by Rafael's avatar Rafael

Corrige caminho dos apps no webpack

parent 68f2e754
Pipeline #7956 passed with stage
in 2 minutes and 11 seconds
......@@ -144,7 +144,7 @@ const output = (env) => ({
chunkFilename: env.production ? 'js/chunks/[name].[chunkhash].js' : 'js/chunks/[name].js',
filename: env.production ? 'js/[name].[contenthash].js' : 'js/[name].js',
path: DIST,
publicPath: '/',
publicPath: '',
})
const devServer = (env) => ({
......
......@@ -2,12 +2,16 @@ const express = require('express')
const path = require('path')
const server = express()
server.use(express.static(path.join(__dirname, 'dist')))
const channel = process.argv[2]
const port = process.argv[3] || 3000
const distPath = channel ? `dist/${channel}` : 'dist'
server.use(express.static(path.join(__dirname, distPath)))
server.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
res.sendFile(path.join(__dirname, distPath, 'index.html'))
})
server.listen(3001, () => {
console.log('Listening at http://localhost:3001/')
server.listen(Number(port), () => {
console.log(`Listening at http://localhost:${port}/`)
})
......@@ -146,7 +146,7 @@ const output = (env) => ({
chunkFilename: env.production ? 'js/chunks/[name].[chunkhash].js' : 'js/chunks/[name].js',
filename: env.production ? 'js/[name].[contenthash].js' : 'js/[name].js',
path: DIST,
publicPath: '/',
publicPath: '',
})
const devServer = (env) => ({
......@@ -172,7 +172,7 @@ module.exports = (env) => {
return {
context: SRC,
mode: env.production ? 'production' : 'development',
entry: ['./index.tsx'],
entry: './index.tsx',
devtool: env.production ? undefined : 'eval-cheap-module-source-map',
devServer: devServer(env),
module: {
......
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