Comments (6)
I also have this warning when using the replace plugin as an output plugin like this
export default {
input: 'index.js',
output: {
dir: 'dist',
format: 'iife', // amd cjs system esm iife umd
plugins: [
replace({'process.env.NODE_ENV': JSON.stringify('production')}),
terser(),
]
}
}
In my case, I actually need it on the output bundle and it is allowed since #55. So why there is that warning?
from plugins.
Are you sure you placed the plugins
option in the correct place? This error can only occur if it is placed inside the output
object. In the documentation you linked, it is placed outside the output
object.
from plugins.
@targumon as the issue template mentions, we need a minimal reproduction to triage this. Without that, there's not much we can do.
Issues without minimal reproductions will be closed! Please provide one by:
- Using the REPL at https://rollupjs.org/repl/, or
- Work to isolate the problem and provide the exact steps in this issue, or
- Provide a minimal repository link (Read https://git.io/fNzHA for instructions).
These may take more time to triage than the other options.
from plugins.
Though it might make sense to be able to use this plugin as an output plugin, it is not supported and also would not really make sense as then it would not benefit from tree-shaking.
from plugins.
Oh, I feel so stupid. I'm not even sure now where did I copy my bad rollup.config.js
from (with plugins
inside output
instead of adjacent to it).
Thanks and my apologies for the trouble!
from plugins.
Found the source of my mistake: before realizing I also need the replace plugin, the first one I used was terser, which is an output plugin... So my initial config had plugins
inside output
and I naturally thought that that's the place for all plugins.
TL;DR (for whoever gets here from search engines):
There are "regular" plugins and there are output plugins, so your rollup.config.js may contain the plugins
option more than once:
export default {
input: 'index.js',
output: {
dir: 'dist',
format: 'iife', // amd cjs system esm iife umd
plugins: [
terser()
]
},
plugins: [
replace({'process.env.NODE_ENV': JSON.stringify('production')})
]
}
More details here: https://rollupjs.org/guide/en/#using-output-plugins
from plugins.
Related Issues (20)
- [@rollup/plugin-node-resolve] Allow fallbacks for dependencies with incorrect exports field on package.json
- @rollup/plugin-alias entries is not work when use customResolver HOT 1
- [@rollup/plugin-eslint] New flat config `eslint.config.js` is not recognized HOT 1
- [@rollup/plugin-esm-shim] Shim inserted incorrectly if source file has `import` in comment HOT 1
- [@rollup/plugin-node-resolve] confusion about what this plugin does HOT 2
- How to tell `--configPlugin` to use specific `tsconfig`? HOT 5
- [@rollup/plugin-node-resolve] resolving package.json exports/imports arrays HOT 1
- Source URLs in generated source map are wrong when `composite` is enabled in tsconfig.json
- requireReturnsDefault: "auto" results in an incorrect bundle for some libraries
- [@rollup/plugin-alias] Allow to configure alias based on entry point
- 在SCSS中如何替换Var变量
- Allow @rollup/plugin-virtual to be a function that takes a module ID
- [@rollup/plugin-tpescript] Rollup does not use `paths` in `rollup.config.ts`
- [@rollup/plugin-typescript] allowImportingTsExtensions warning
- [@rollup/plugin-tpescript] Rollup does not get `module` and `moduleResolution` settings from extended `tsconfig.json`
- [@rollup/plugin-json] won't process files without json suffix HOT 4
- CommonJS plugin version bump to 26.0.0 causes build issue HOT 4
- Confusing explanation in @rollup/plugin-typescript's README
- [@rollup/plugin-swc] leads to unusable bundle in combination with [@rollup/plugin-commonjs] and [@rollup/plugin-node-resolve]
- I don't know if this is a mistake
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugins.