Comments (9)
@smlombardi Show log. Show build code.
from gulp-postcss.
from gulp-postcss.
@smlombardi Try this
gulp.task('style', function(done) {
return sass('source', { sourcemap: true })
.on('error', done)
.pipe(postcss([autoprefixer({
browsers: ['last 2 versions']
})]))
.on('error', done)
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('result'))
.pipe(reload({ stream: true }));
});
from gulp-postcss.
@smlombardi But if you start new project try to use postcss alternatives like precss or cssnext. You can also combain different plugins and for example use cssnext with nested.
from gulp-postcss.
I get this with the above code:
STARYU:designsystem stevelombardi$ gulp style
[13:54:31] Using gulpfile ~/Documents/designsystem/gulpfile.js
[13:54:31] Starting 'style'...
[13:54:32] gulp-ruby-sass stdout: directory
[13:54:32] gulp-ruby-sass stdout: write design_system.css
write design_system.css.map
[13:54:32] gulp-ruby-sass stdout: write live_preview.css
write live_preview.css.map
[13:54:33] 'style' errored after 1.03 s
[13:54:33] TypeError in plugin 'gulp-postcss'
Message:
object is not a function
STARYU:designsystem stevelombardi$
Here, with my paths added:
gulp.task('style', function(done) {
return sass('app/assets/sass/', {
sourcemap: true
})
.on('error', done)
.pipe(postcss([autoprefixer({
browsers: ['last 2 versions']
})]))
.on('error', done)
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('app/assets/css/'))
.pipe(reload({
stream: true
}));
});
from gulp-postcss.
I can this same error with the same workflow. Any idea's what is happening here?
from gulp-postcss.
For what it is worth, if you remove autoprefixer as a postprocessor, it seems to work.
from gulp-postcss.
@smlombardi @rstuart85 Show whole code
from gulp-postcss.
Fix posted on the stackoverflow question. Essentially, it seems to be down to which package you are using autoprefixer from. This doesn't work (produces the error described):
var autoprefixer = require('gulp-autoprefixer');
This does work (no more error):
var autoprefixer = require('autoprefixer-core');
That's all you need to change. You can test with the code posted above.
from gulp-postcss.
Related Issues (20)
- Error in plugin "gulp-postcss" HOT 1
- PostCSS 8 support HOT 9
- Extension css for output HOT 2
- PostCSS plugin autoprefixer requires PostCSS 8. Update PostCSS or downgrade this plugin HOT 6
- Use postcss-load-config 3.0
- Error: [object Object] is not a PostCSS plugin HOT 1
- CSS Syntax Error, alien script, and ELIFECYCLE error on build HOT 9
- Sourcemaps always shows parent line for nested SASS HOT 1
- Support "watch" mode (equivalent to -w switch in postcss-cli) HOT 6
- PostCSS dependency messages are not respected HOT 2
- Error: PostCSS plugin autoprefixer requires PostCSS 8. HOT 3
- Outputing multi-level folders HOT 1
- Error plugin is not a function HOT 2
- Not working with TailwindCSS >=3.0 HOT 1
- CssSyntaxError in plugin "gulp-postcss" / You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser HOT 1
- TypeError in plugin "gulp-postcss" plugin is not a function HOT 1
- ENOENT: No such file or directory (sass/postcss/tailwind)
- s.default.isPseudoElement is not a function HOT 1
- Update `postcss-load-config` HOT 1
- Why does the new version 9.1.0 not comply with semver about engines.node? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-postcss.