CSS Imports
All Axiom components import their own CSS files via import statements from within the JS code.
Depending on your bundler you might require additional configuration to enable CSS imports.
Check out the guide on CSS Layers if your existing styles are conflicting with Axiom.
#
Next.js
#
#
Turbopack
#
If you are using Turbopack then you need to add our packages to the optimizePackageImports option:
next.config.js
export default {
// ...
experimental: {
optimizePackageImports: ["@optiaxiom/globals", "@optiaxiom/react"],
},
};#
Webpack
#
If you are using Webpack then you need to add our packages to the transpilePackages option:
next.config.js
export default {
// ...
transpilePackages: ["@optiaxiom/globals", "@optiaxiom/react"],
};#
Webpack
#
#
Configure loaders
#
Follow the Webpack Asset Management guide to configure loading CSS and fonts.
Install the required style loaders.
npm install -D style-loader css-loaderAdd the appropriate loaders in your Webpack config file.
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: "asset/resource",
},
],
},
};Last updated on