Comments (9)
@pbek you need to name the file webextension-toolbox.config.js
(note the period/dot between "toolbox" and "config"), as defined in the main binary file/script here. With that name you can place it in the root directory and have it picked up automatically.
This appears to be an issue with the documentation; I will work on a PR to get it fixed.
from webextension-toolbox.
- add
app/webextension-toolbox-config.js
with just one line: const webpack = require('webpack') like described here
@pbek You have to add webextension-toolbox-config.js
to the project root. Not into app
folder
from webextension-toolbox.
Originally (at version 3) I had it in the root directory, but the file gets ignored completely in the root directory in version 4 (see #309 (comment)).
from webextension-toolbox.
I just tried again with 4.0.3. The only directory where webextension-toolbox-config.js
seems to get recognized is when it is in the app
directory. Putting it into the project root (so one level up from app
) work out for me.
from webextension-toolbox.
Thank you for the hint. The file seems to be recognized now, but with a const webpack = require('webpack')
in it (according to the documentation) you will now get 82 errors and 10 warnings
, like:
ERROR in ../node_modules/webpack/lib/util/fs.js 8:13-28
Module not found: Error: Can't resolve 'path' in '/home/omega/Test/web-extension/node_modules/webpack/lib/util'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
@ ../node_modules/webpack/lib/CleanPlugin.js 12:17-37
@ ../node_modules/webpack/lib/index.js 141:9-33
@ ./webextension-toolbox.config.js 1:16-34
ERROR in ../node_modules/webpack/lib/util/identifier.js 7:13-28
Module not found: Error: Can't resolve 'path' in '/home/omega/Test/web-extension/node_modules/webpack/lib/util'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
@ ../node_modules/webpack/lib/Compiler.js 33:30-58
@ ../node_modules/webpack/lib/index.js 147:9-30
@ ./webextension-toolbox.config.js 1:16-34
ERROR in ../node_modules/webpack/lib/webpack.js 8:13-28
Module not found: Error: Can't resolve 'util' in '/home/omega/Test/web-extension/node_modules/webpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }
@ ../node_modules/webpack/lib/index.js 95:30-50 98:9-29
@ ./webextension-toolbox.config.js 1:16-34
from webextension-toolbox.
I am not sure that it will help, but I do not require webpack const webpack = require('webpack')
in my webextension-toolbox.config.js
. And it works.
My file looks like:
module.exports = {
webpack: (config) => {
// my code here
return config;
}
};
from webextension-toolbox.
@onikienko, that really helped. Thank you very much!
I needed to drop my:
config.plugins.push(new webpack.ProvidePlugin({
Vue: 'vue',
VueLoader: 'vue-loader'
}));
But I could use:
const VueLoaderPlugin = require('vue-loader/lib/plugin');
...at the start of webextension-toolbox.config.js
.
Seems like https://github.com/webextension-toolbox/webextension-toolbox#customizing-webpack-config needs even more changes.
from webextension-toolbox.
I created a PR #515 for the documentation change.
from webextension-toolbox.
Closed from #515
from webextension-toolbox.
Related Issues (20)
- `@babel/preset-env` Ignores Project Browserslist Config for `targets` HOT 1
- Doesn't build when there is no /app/_locales/**/*.json
- Localization keys are not replaced with strings HOT 2
- Maintainers or Abandoned? HOT 8
- --autoReload flag not working properly HOT 1
- v5 - Future HOT 12
- Error: listen EADDRINUSE: address already in use :::35729 HOT 1
- Setup with additional webextension-toolbox.config.js config seems to fail on windows 11 HOT 10
- Incognito manifest key "split" is incorrectly blocked by the web extension toolbox at the build time. HOT 2
- digital envelope routines::unsupported HOT 2
- web_accessible_resources ignore js file HOT 2
- Error: invalid relative path: ../../packages/webext.v0.0.1.chrome.zip when trying to build extension HOT 6
- Reloader connection fails with manifest V3 HOT 7
- Chalk is an implicit dependency (should be explicit) HOT 1
- Request for Node.js 20 Support HOT 2
- Use Browserslist Configuration for Vendor Versions HOT 1
- How to set default config location HOT 1
- DEV environment is not properly set HOT 1
- How to skip minification and optimization js assets?
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 webextension-toolbox.