Nativescript Angular code sharing project problem with Webpack

后端 未结 2 886
情深已故
情深已故 2020-12-22 01:21

I have created a code-sharing projects with Angular 8.30 and Nativescript.

When I run ng serve, the app builds ok. However with tns run android

2条回答
  •  抹茶落季
    2020-12-22 02:15

    The same happened to me and When I try to edit webpack.config.js it works for me just replace the lines

     new CopyWebpackPlugin([
                { from: { glob: "fonts/**" } },
                { from: { glob: "**/*.jpg" } },
                { from: { glob: "**/*.png" } },
            ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
    

    to be

    new CopyWebpackPlugin({
                patterns: [
                  { from: "fonts/**", globOptions: { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] } },
                  { from: "**/*.{jpg,png}", globOptions: { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] } },
                ]
              }, { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
    

    and do not forget to add fonts folder if you do not have one

提交回复
热议问题