lydell / autoprefixer-brunch Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Adds autoprefixer support to brunch.
License: MIT License
[DEPRECATED] Adds autoprefixer support to brunch.
License: MIT License
I get TypeError: Cannot read property 'css' of undefined
when I try to use autoprefixer-brunch. I am building generated/
from src/
. It worked well before I added autoprefixer-brunch.
My config.js looks like this:
/**
* brunch config
*/
exports.config = {
paths: {
'public': 'generated',
'watched':['src']
},
files: {
javascripts: {
defaultExtension: 'js',
joinTo: {
'js/app.js': /^src/,
'js/ie.js': /^bower_components[\\/](?=json3|es5-shim)/,
'js/vendor.js': /^bower_components[\\/](?!json3|es5-shim)/,
}
},
stylesheets: {
defaltExtension: 'less',
joinTo: {
'css/site.css': /^src\/less\/site.less/,
}
}
},
plugins:{
autoprefixer:{
browsers: ["last 1 version", "> 1%", "ie 8", "ie 7"]
}
},
framework: 'AngularJS',
server:{
path: 'app.js',
port: 5000,
base: 'generated'
}
};
and my package.json looks like this:
{
"name": "project",
"version": "0.0.0",
"author": "David Konsumer <[email protected]>",
"dependencies": {
"express": "^4.0.0",
"morgan": "^1.0.0",
"serve-static": "^1.0.4",
"body-parser": "^1.0.2",
"chalk": "^0.4.0"
},
"devDependencies": {
"brunch": "^1.7.13",
"less-brunch": ">=1.7.0",
"autoprefixer-brunch": "^1.7.7",
"clean-css-brunch": ">=1.7.1",
"javascript-brunch": ">=1.7.0",
"ngmin-uglify-js-brunch": "~1.7.2",
"auto-reload-brunch": "^1.7.3"
},
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"start": "brunch w -s"
}
}
The full error, when I run brunch b
(even with --production
,) looks like this:
/Users/konsumer/Documents/Projects/PROJECT/node_modules/autoprefixer-brunch/lib/index.js:34
data: result.css,
^
TypeError: Cannot read property 'css' of undefined
at AutoprefixerCompiler.module.exports.AutoprefixerCompiler.compile (/Users/konsumer/Documents/Projects/PROJECT/node_modules/autoprefixer-brunch/lib/index.js:34:19)
at /Users/konsumer/Documents/Projects/PROJECT/node_modules/brunch/lib/fs_utils/pipeline.js:94:31
at fn (/Users/konsumer/Documents/Projects/PROJECT/node_modules/brunch/node_modules/async-waterfall/index.js:19:24)
at Object._onImmediate (/Users/konsumer/Documents/Projects/PROJECT/node_modules/brunch/node_modules/async-waterfall/index.js:58:22)
at processImmediate [as _immediateCallback] (timers.js:330:15)
I think this plugin should just concern itself with CSS only (not LESS, Sass, Stylus, etc.) by removing the EDIT: Likely not the solution.pattern
parameter since it would likely be one of the last steps. (at least before minification)
One issue that happens is I may have a file called variables.xxx
or mixins.xxx
that only contains variables and mixins that are to be included in other files. Those files don't have any CSS and the plugin complains that result
is undefined. I could avoid this by preceding with an underscore, but then it doesn't get monitored by watch.
According to Brunch docs, current versioning does not follow Brunch guidelines.
For example, I am using brunch 1.7.17, I use >= 1.0 < 1.8
, version 1.8.3 (the current version) which is compatible with 1.7.17, will not be a candidate for update (npm outdated --depth=0
) when running npm update
Solution would be to change the current version to at least 1.7.14
but less than 1.8
, otherwise workaround for users would be to change the version to >= 1.0 < 1.8.4
or 1.8.4
.
Autoprefixer can accept existing source maps. Plugin currently does not use map from Brunch, breaking source map flow. Something like this should fix it.
result = @compiler.process(data, {map: JSON.stringify(map), from: path})
In REDAME “branch” link use https
protocol, but branch.io
answers only on http
.
Hi, I'm trying to get sass and sourcemaps working with brunch but install fails. Typing npm install --save autoprefixer-brunch
, I get the following NPM error:
Error: No compatible version found: autoprefixer@'lydell/autoprefixer#source-maps'
Something missing?
Please, use autoprefixer-core
, instead of autoprefixer
npm package. Core package was cleaned from file system and CLI code and has no fs-extra
dependency.
The readme states "Deprecated. Please use postcss-brunch instead." However, the node package page does not. It should.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.