forked from egoist/tailwindcss-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
59 lines (58 loc) · 1.49 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const { join } = require("path");
const SizePlugin = require("size-plugin");
const webpack = require("webpack");
/** @type {import('webpack').Configuration} */
module.exports = {
entry: "./index.js",
devtool: false,
output: {
path: __dirname + "/dist",
filename: "index.js",
libraryTarget: "umd",
library: "tailwindcss",
},
performance: {
hints: false,
},
resolve: {
alias: {
fs: join(__dirname, "fs.js"),
"fast-glob": join(__dirname, "fast-glob.js"),
jiti: join(__dirname, "fake-jiti"),
crypto: require.resolve("crypto-browserify"),
os: require.resolve("os-browserify/browser"),
path: require.resolve("path-browserify"),
stream: require.resolve("stream-browserify"),
util: require.resolve("util/"),
assert: require.resolve("assert/"),
buffer: require.resolve("buffer/"),
process: require.resolve("process/browser"),
tty: require.resolve("tty-browserify"),
vm: require.resolve("vm-browserify"),
url: require.resolve("url/"),
},
fallback: {
perf_hooks: false,
"@tailwindcss/line-clamp": false,
},
},
module: {
rules: [
{
test: /preflight\.js$/,
loader: join(__dirname, "loader.js"),
},
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
},
],
},
plugins: [
new SizePlugin(),
new webpack.ProvidePlugin({
process: require.resolve("process/browser"),
}),
],
};