Building tutorial with WebPack gives Unknown Word


#1

After following the steps in this tutorial: https://docs.nativescript.org/tutorial/chapter-0 I wanted to follow up by following the steps from: https://docs.nativescript.org/best-practices/startup-times

After installing nativescript-dev-webpack and running npm run start-android-bundle I am greeted by the following traceback:

ERROR in ../node_modules/nativescript-css-loader?{"minimize":false}!../node_modules/tns-core
-modules/platform/platform.android.js
Module build failed: Unknown word (1:1)

> 1 | Object.defineProperty(exports, "__esModule", { value: true });
    | ^
  2 | var appModule = require("../application");
  3 | var MIN_TABLET_PIXELS = 600;
  4 | var platformNames;

 @ ./app.css 3:10-90

ERROR in ./app.css
Module build failed: ModuleBuildError: Module build failed: Unknown word (1:1)

> 1 | Object.defineProperty(exports, "__esModule", { value: true });
    | ^
  2 | var appModule = require("../application");
  3 | var MIN_TABLET_PIXELS = 600;
  4 | var platformNames;

    at runLoaders (x/node_modules/webpack/lib/NormalModule.js:193:19)
    at x/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at x/node_modules/loader-runner/lib/LoaderRunner.js:230:18
    at context.callback (x/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.<anonymous> (x/node_modules/nativescript-css-loader/lib/loader.js:32:18)
    at x/node_modules/nativescript-css-loader/lib/processCss.js:226:4
    at <anonymous>
    at runMicrotasksCallback (internal/process/next_tick.js:121:5)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

My webpack.config.js has not been changed by me (yet). If I follow along it seems like it is trying to pack a javascript file into app.css. I think I’ve found the relevant part of the configuration here:

        // Root stylesheet gets extracted with bundled dependencies
        {
            test: new RegExp(mainSheet),
            use: ExtractTextPlugin.extract([
                {
                    loader: "nativescript-css-loader",
                    options: { minimize: false }
                },
                {
                    loader: "resolve-url-loader",
                    options: { silent: true },
                },
                "nativescript-dev-webpack/platform-css-loader",
            ]),
        },

And since that is referring to app.css I think the relevant bit from that file is

@import url('~platform.css');

Removing that line fixes the issue but I think also removes my ability to include platforms based on my build.

Is this a known bug and/or is there a way I can work around this?

My nativescript version is ~3.0.0.