20 lines
586 B
JavaScript
20 lines
586 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/ForegroundService.js'),
|
|
]
|
|
appComponents.map((component) => {
|
|
config.entry('bundle').add(component)
|
|
})
|
|
}
|
|
})
|
|
return webpack.resolveConfig()
|
|
}
|