globalName, globals and publicPath settings have no effect
See original GitHub issueEnvironment
Nuxt CLI v3.0.0-27243104.5e903ae 16:12:01 RootDir: /Users/stewan/dev/stewan-nuxt 16:12:02 Nuxt project info: 16:12:02
- Operating System:
Darwin
- Node Version:
v14.17.6
- Nuxt Version:
3.0.0-27243104.5e903ae
- Package Manager:
npm
- Bundler:
Vite
- User Config:
css
,build
- Runtime Modules:
-
- Build Modules:
-
Describe the bug
globalName
, globals
and publicPath
settings have no effect
Reproduction
I followed the basic setup for nuxt3 on docs
and tried this config
import { defineNuxtConfig } from "nuxt3";
export default defineNuxtConfig({
globalName: "__stew",
globals: {
id: () => `__stew`,
},
css: ["~/assets/css/tailwind.css"],
build: {
publicPath: "stew/",
postcss: {
postcssOptions: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
},
},
});
nothing works when building for production. in dev publicPath sometimes work, sometimes not
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Configure webpack publicPath setting has no effect
I have setup a dev server running, meteor, react, webpack. When I load up the site located here: vps.elemental.co.za:3000 all starts off OK ......
Read more >API - esbuild
Banner; Charset; Color; Drop; Footer; Global name; Ignore annotations; JSX; JSX dev ... Note that this setting only has an effect when bundling...
Read more >The build Property - Nuxt
Nuxt lets you customize the webpack configuration for building your web application as you want.
Read more >rollup.js
Rollup configuration files are optional, but they are powerful and convenient and thus recommended. A config file is an ES module that exports...
Read more >Public Path - webpack
The publicPath configuration option can be quite useful in a variety of ... In development for example, we might have an assets/ folder...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For the same reason as publicPath, white labeling. Depending on the project, it’s important to hide the tech stack behind the scenes.
I’m expecting that something like the
globalName
will be added back in once Nuxt3 goes GA. There were a ton of requests for it due to what @stewones mentioned. My 2 primary needs for it are related to hiding the tech stack and changing the CSS for the<body><div id="__nuxt">
element. Without being able to change the global name for that element, Nuxt users will need to add CSS to their global styles that reference a DOM id that is hidden, (read: not configurable or documented) and could change at any time.I suppose a partial solution for me would be if we could change the attrs for that element via the meta composable, like we do for head and body. But that still leaves the tech-stack obfuscation issue.