Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tonymurray opened this issue Apr 11, 2023 · 3 comments
Open

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

tonymurray opened this issue Apr 11, 2023 · 3 comments

Comments

@tonymurray
Copy link

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?

@ghost
Copy link

ghost commented Apr 14, 2023

Thanks for the quick solution, you saved me a lot of time, @tonymurray!

@eikaramba
Copy link

you can also just add this:
webpack.mergeWebpack({ resolve: {conditionNames:['svelte','require','node'] }})

@danawoodman
Copy link

Crazy this is still an open issue, just setup a brand new project and was greeted with this error. Is this something upstream in Native Script or in Svelte Native?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants