Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

"resolve.conditionNames" array warning about webpack.config.js #337

@tonymurray

Description

@tonymurray

When I create a default new Nativescript svelte application:
ns create blankapp --svelte
cd blankapp && ns debug android

I get a warning:
WARNING: You should add "svelte" to the "resolve.conditionNames" array in your webpack config. See https://github.com/sveltejs/svelte-loader#resolveconditionnames for more information

The default webpack.config.js file is:

const webpack = require("@nativescript/webpack");
module.exports = (env) => {
webpack.init(env);
return webpack.resolveConfig();
};

Following some research/trial-and-error at: https://webpack.js.org/configuration/resolve/#resolveconditionnames
I change webpack.config.js to:

const webpack = require("@nativescript/webpack");
module.exports = env => {
webpack.init(env)
module.exports = {
resolve: {
conditionNames: ['svelte'],
},
}
return webpack.resolveConfig()
}

...Then the warning goes away.
Is this an appropriate solution in relation to the warning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions