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-commonjs]: dynamically requiring a built-in node.js module in an esm script will always throw
- [@rollup/plugin-commonjs] commonjs does not recognize named cjs exports HOT 1
- virtual plugin creates files that are ignored by any plugin that uses createFilter
- Parsing fails when a class property is named global
- The node-resolve plugin seems to break Vue when the Vue app imports a lib and consumes a native web components.
- Adopt updated rollup-plugin-delete? HOT 2
- [@rollup/plugin-graphql] Processing GraphQL queries declared in template files
- Watch mode: multiple saves required for changes to be transpiled correctly HOT 1
- (Compilation) error RollupError: Expected '{', got 'interface' / token 'static' . Expected * for generator, private key, identifier or async HOT 2
- [@rollup/plugin-commonjs]: vulnerability in inflight
- [@rollup/plugin-commonjs]: Which Comes First?The Documentation Seems to Be Conflicting
- [@rollup/plugin-replace] Missing sourceMap option within Readme HOT 2
- (@rollup/plugin-typescript) Cannot import typescript file from parent folder (../script) without .ts file extension (../script.ts)
- [!] (plugin typescript) RollupError: [plugin typescript] @rollup/plugin-typescript: Path of Typescript compiler option 'outDir' must be located inside Rollup 'dir' option.
- [@rollup/plugin-typescript] Cannot resolve input filepath which is absolute path and begin with lower case drive letter on windows
- [@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
- [@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
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.