const path = require('path')
const { name } = require('./package.json')
const pathResolve = (pathUrl) => path.join(__dirname, pathUrl)
module.exports = {
reactScriptsVersion: 'react-scripts' ,
webpack: {
alias: {
'@': pathResolve('src'),
'@assets': pathResolve('src/assets'),
'@components': pathResolve('src/components'),
'@constants': pathResolve('src/constants'),
'@containers': pathResolve('src/containers'),
'@hooks': pathResolve('src/hooks'),
'@mocks': pathResolve('src/mocks'),
'@routes': pathResolve('src/routes'),
'@services': pathResolve('src/services'),
'@styles': pathResolve('src/styles'),
'@types': pathResolve('src/types'),
'@utils': pathResolve('src/utils'),
'@contexts': pathResolve('src/contexts'),
},
configure(webpackConfig) {
webpackConfig.resolve.extensions = [
...webpackConfig.resolve.extensions,
...['.scss', '.css'],
]
webpackConfig.output.library = `${name}-[name]`
webpackConfig.output.libraryTarget = 'umd'
webpackConfig.output.globalObject = 'window'
return webpackConfig
},
},
devServer: {
port: 3001,
headers: {
'Access-Control-Allow-Origin': '*',
},
},
}