Skip to content

Commit 9fe653c

Browse files
committed
use webpack loader
1 parent 9561c9e commit 9fe653c

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

packages/next/next-devtools.webpack-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ module.exports = ({ dev, ...rest }) => {
9191
module: {
9292
rules: [
9393
{ test: /\.m?js$/, loader: `source-map-loader`, enforce: `pre` },
94+
{
95+
test: /\.css$/,
96+
resourceQuery: /raw/,
97+
type: 'asset/source',
98+
},
9499
{
95100
test: /\.(ts|tsx)$/,
96101
exclude: [/node_modules/],
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
/* The location of this file is considered the entrypoint. */
2+
/* You can set the base path with `source("../path")`, but locating this file is more reliable. */
13
@import 'tailwindcss';
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
export { Tailwind } from './tailwind.gen'
1+
import tailwindCss from './tailwind.output.css?raw'
2+
import { css } from '../../utils/css'
3+
4+
export function Tailwind() {
5+
return (
6+
<style>{css`
7+
${tailwindCss}
8+
`}</style>
9+
)
10+
}

packages/next/types/global.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ declare module '*.module.scss' {
4343
export default classes
4444
}
4545

46+
declare module '*.css?raw' {
47+
const content: string
48+
export default content
49+
}
50+
4651
// We implement the behavior of `import 'server-only'` and `import 'client-only'` on the compiler level
4752
// and thus don't require having them installed as dependencies.
4853
// By default it works fine with typescript, because (surprisingly) TSC *doesn't check side-effecting imports*.

0 commit comments

Comments
 (0)