Solution #4 and #5: Can't resolve './app.css'

Consider the 4th and 5th errors mentioned in the Preparing to use webpack section:

4. ERROR in Entry module not found: Error: Can't resolve './app.css' in '/path/to/TNSStudio/app'5. ERROR in [copy-webpack-plugin] unable to locate 'app.css' at '/path/to/TNSStudio/app/app.css'

The solution to the preceding error is actually related to the fact that we are using platform-specific .ios.css and .android.css, which is compiled via SASS. We need to update our webpack config so that it knows this. Open webpack.config.js, which the plugin added for us automatically, and make the following changes:

module.exports = env => {  const platform = getPlatform(env); // Default destination inside platforms/<platform>/... ...

Get NativeScript for Angular Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.