-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.mix.js
40 lines (37 loc) · 1.07 KB
/
webpack.mix.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
const mix = require('laravel-mix');
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const tailwindcss = require('tailwindcss');
const postCssPrefixSelector = require('postcss-prefix-selector');
const excludedSelectors = [
'.pcc-content',
'.pcc-notice',
'.pcc-icon',
'.pcc-post-title-container'
];
const shouldExcludeSelector = (selector) => excludedSelectors.includes(selector);
mix.options({
manifest: false,
legacyNodePolyfills: true
}).webpackConfig({
plugins: [
new NodePolyfillPlugin(),
],
resolve: {
fallback: {
fs: false,
child_process: false
}
}
}).js('assets/js/app.js', 'dist').js('assets/js/pcc-front.js', 'dist').postCss('assets/css/app.css', 'dist', [
tailwindcss('./tailwind.config.js'),
postCssPrefixSelector({
prefix: '.pcc-content', // Replace with your desired class
transform(prefix, selector, prefixedSelector) {
// Exclude 'html' and 'body' tags from being prefixed
if (shouldExcludeSelector(selector)) {
return selector;
}
return prefixedSelector;
},
}),
]);