I am having trouble import CSS file in Nextjs code. I have the following CSS file:
./src/components/Layouts.css
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
In index.js, I have the following code:
import React from 'react';
import ReactDOM from 'react-dom';
import Layout from "../src/hoc/Layout/Layout";
import Main from "../src/components/Main/Main";
const Index = () => (
<Layout>
<Main />
</Layout>
);
export default Index
In Layout.js, I have the following code:
import React, { Component } from 'react';
import Aux from '../Aux/Aux';
import './Layout.css';
import { BrowserRouter, Route, NavLink, Switch } from 'react-router-dom';
import Header from '../../components/Navigation/Header/Header';
import Footer from "../../components/Footer/Footer";
class Layout extends Component {
render () {
return (
<Aux>
<Header />
{this.props.children}
<Footer />
</Aux>
)
}
}
export default Layout;
I get the error
ModuleParseError: Module parse failed: Unexpected token (10:37)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| a, abbr,
What I did:
In next-config.js, I added the following:
const withCSS = require('@zeit/next-css')
module.exports = withCSS({
/* config options here */
})
What am I doing wrong?
|
@zeit/next-css?