replace sass with postcss

This commit is contained in:
Ray Elliott 2021-03-27 16:28:49 +00:00
parent cb322cadc4
commit 0b5f427a41
3 changed files with 35 additions and 8 deletions

View File

@ -2,19 +2,23 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "npm run development", "dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch", "watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll", "watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production", "prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^5.2.0", "cross-env": "^7.0.3",
"laravel-mix": "^4.0.13", "laravel-mix": "^6.0.13",
"postcss": "^7.0.35", "postcss": "^8.2.8",
"sass": "^1.15.2", "postcss-functions": "^4.0.2",
"sass-loader": "^7.1.0", "postcss-import": "^14.0.0",
"vue-template-compiler": "^2.5.22" "postcss-mixins": "^7.0.3",
"postcss-nesting": "^7.0.1",
"postcss-preset-env": "^6.7.0",
"postcss-simple-vars": "^6.0.3",
"vue-template-compiler": "^2.6.12"
} }
} }

5
src/css/style.css Normal file
View File

@ -0,0 +1,5 @@
/* css to go here */
body {
background-color: blue;
}

18
webpack.mix.js Normal file
View File

@ -0,0 +1,18 @@
let mix = require('laravel-mix');
mix.options({
processCssUrls: false,
autoprefixer: {
enabled: true,
options: {
overrideBrowserslist: ['last 2 versions', '> 1%'],
cascade: true,
grid: true,
}
},
})
.setPublicPath('/')
// .sass('src/scss/style.scss', 'assets/css/style.css')
.postCss('src/css/style.css', 'assets/css/style.css')
.js('src/js/app.js', 'assets/js/scripts.js')
.version();