enrecipes/webpack.config.js
2021-06-18 21:52:24 +05:30

20 lines
595 B
JavaScript

const webpack = require('@nativescript/webpack')
const path = require('path')
module.exports = (env) => {
webpack.init(env)
const platform = webpack.Utils.platform.getPlatformName()
webpack.chainWebpack((config) => {
if (platform === 'android') {
const appComponents = [
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity',
path.resolve(__dirname, 'app/services/ForegroundService.js'),
]
appComponents.map((component) => {
config.entry('bundle').add(component)
})
}
})
return webpack.resolveConfig()
}