@s-ui/bundler 9.37.0-beta.0 → 9.37.0-tailwind.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/sui-bundler.js +1 -1
- package/package.json +3 -2
- package/shared/index.js +4 -0
- package/shared/module-rules-sass.js +2 -1
- package/webpack.config.dev.js +5 -1
- package/webpack.config.prod.js +4 -1
package/bin/sui-bundler.js
CHANGED
|
@@ -11,7 +11,7 @@ program
|
|
|
11
11
|
.command('lib', 'Compile a library to a bundle with chunks.')
|
|
12
12
|
.command(
|
|
13
13
|
'analyzer',
|
|
14
|
-
'Compile all assets and create a HTML
|
|
14
|
+
'Compile all assets and create a HTML inspector for your bundle'
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
program.parse(process.argv)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s-ui/bundler",
|
|
3
|
-
"version": "9.37.0-
|
|
3
|
+
"version": "9.37.0-tailwind.0",
|
|
4
4
|
"description": "Config-free bundler for ES6 React apps.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sui-bundler": "./bin/sui-bundler.js"
|
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
"stream-http": "3.2.0",
|
|
47
47
|
"strip-ansi": "6.0.1",
|
|
48
48
|
"style-loader": "3.3.1",
|
|
49
|
+
"tailwindcss": "3.2.7",
|
|
49
50
|
"url": "0.11.0",
|
|
50
51
|
"webpack": "5.74.0",
|
|
51
52
|
"webpack-dev-server": "4.10.0",
|
|
52
53
|
"webpack-manifest-plugin": "5.0.0",
|
|
53
54
|
"webpack-node-externals": "3.0.0"
|
|
54
55
|
}
|
|
55
|
-
}
|
|
56
|
+
}
|
package/shared/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
1
2
|
const {config} = require('./config.js')
|
|
2
3
|
|
|
3
4
|
exports.MAIN_ENTRY_POINT = './app.js'
|
|
@@ -7,6 +8,9 @@ exports.cleanList = list => list.filter(Boolean)
|
|
|
7
8
|
|
|
8
9
|
exports.when = (check, getValue) => (check ? getValue() : false)
|
|
9
10
|
|
|
11
|
+
exports.isTailwindEnabled = () =>
|
|
12
|
+
fs.existsSync(`${process.cwd()}/tailwind.config.js`)
|
|
13
|
+
|
|
10
14
|
exports.envVars = (env = []) =>
|
|
11
15
|
env.reduce(
|
|
12
16
|
(acc, variable) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
2
2
|
|
|
3
|
-
const {cleanList, config, when} = require('./index')
|
|
3
|
+
const {cleanList, config, when, isTailwindEnabled} = require('./index')
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
test: /(\.css|\.scss)$/,
|
|
@@ -18,6 +18,7 @@ module.exports = {
|
|
|
18
18
|
options: {
|
|
19
19
|
postcssOptions: {
|
|
20
20
|
plugins: [
|
|
21
|
+
...(isTailwindEnabled() ? [require('tailwindcss').default()] : []),
|
|
21
22
|
require('autoprefixer')({
|
|
22
23
|
overrideBrowserslist: config.targets
|
|
23
24
|
})
|
package/webpack.config.dev.js
CHANGED
|
@@ -9,7 +9,8 @@ const {
|
|
|
9
9
|
MAIN_ENTRY_POINT,
|
|
10
10
|
config,
|
|
11
11
|
cleanList,
|
|
12
|
-
when
|
|
12
|
+
when,
|
|
13
|
+
isTailwindEnabled
|
|
13
14
|
} = require('./shared/index.js')
|
|
14
15
|
const definePlugin = require('./shared/define.js')
|
|
15
16
|
const manifestLoaderRules = require('./shared/module-rules-manifest-loader.js')
|
|
@@ -99,6 +100,9 @@ const webpackConfig = {
|
|
|
99
100
|
options: {
|
|
100
101
|
postcssOptions: {
|
|
101
102
|
plugins: [
|
|
103
|
+
...(isTailwindEnabled()
|
|
104
|
+
? [require('tailwindcss').default()]
|
|
105
|
+
: []),
|
|
102
106
|
require('autoprefixer')({
|
|
103
107
|
overrideBrowserslist: config.targets
|
|
104
108
|
})
|
package/webpack.config.prod.js
CHANGED