尝试使用pingCRM githubwebpack.mix.js
提供的惯性js :
const path = require('path')
const mix = require('laravel-mix')
const cssImport = require('postcss-import')
const cssNesting = require('postcss-nesting')
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix
.js('resources/js/app.js', 'public/js')
.vue()
.postCss('resources/css/app.css', 'public/css', [
// prettier-ignore
cssImport(),
cssNesting(),
require('tailwindcss'),
])
.webpackConfig({
output: { chunkFilename: 'js/[name].js?id=[chunkhash]' },
resolve: {
alias: {
vue$: 'vue/dist/vue.runtime.esm.js',
'@': path.resolve('resources/js'),
},
},
})
.version()
.sourceMaps()
tailwindcss
请注意,您可能必须按照可以在此处找到的设置说明进行操作,仅当您打算使用它时才这样做,否则require('tailwindcss'),
从 webpack 文件中删除
您可能还需要,npm install --save-dev postcss-import
并且标志会将其添加到您的npm install --save-dev postcss-nesting
文件中以供将来参考--save-dev
package.json