Reputation: 1294
please how do I combine these 2 and export
module.exports = withCSS(withImages())
module.exports = {
publicRuntimeConfig: {
API_URL: 'api_url'
},
}
Upvotes: 7
Views: 17379
Reputation: 2938
You can expose it as a part of your configuration by attaching a property withCSS
to the exported config object.
module.exports = {
withCSS: withImages(),
publicRuntimeConfig: {
API_URL: 'api_url'
},
}
Upvotes: 1
Reputation: 49220
You can use next-compose-plugins library to add multiple plugins in config.next.js
file:
const withPlugins = require('next-compose-plugins');
const sass = require('@zeit/next-sass');
module.exports = withPlugins([
[sass],
]);
Upvotes: 1
Reputation: 173
As documented here. You pass your plugins, and then the config.
module.exports = withCSS(withImages({
publicRuntimeConfig: {
API_URL: 'api_url'
},
}));
Edit: Example Usage.
Upvotes: 3
Reputation: 7492
Simply put them together in your final object :
module.exports = {
publicRuntimeConfig: {
API_URL: 'api_url'
},
myCSS: withCSS(withImages())
}
You now just have to add '.myCSS' next to you imported variable to access the second element
Upvotes: 1