michael-ciniawsky / postcss-load-plugins Goto Github PK
View Code? Open in Web Editor NEWAutoload Plugins for PostCSS
License: Other
Autoload Plugins for PostCSS
License: Other
Branch | Build failing π¨ |
---|---|
Dependency | coveralls |
Current Version | 2.11.15 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As coveralls is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 13 commits .
8dfcfd6
version bump
4bc93ac
Merge branch 'master' of github.com:nickmerwin/node-coveralls
671acca
removed codeship badge
f390392
Merge pull request #152 from ndaidong/master
de968b0
Merge pull request #147 from hyperlink/update-request-dep
72a4046
Merge pull request #154 from a0viedo/patch-1
87b27f7
Merge pull request #142 from Hirse/feature/travis-pr
3edbecb
Merge pull request #155 from kasperlewau/master
d117e3d
reenable drone
dd230f6
don't hardcode minor version
cc0882d
Update outdate dependencies
99edf1a
Fix node-uuid deprecation by updating request dependency
f94b647
Get PR number from TRAVIS
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
This is more of a newbie question than an issue but if you could point me in the right direction I'd appreciate it.
So I've added the plugins to my package.json
devDependencies:
"devDependencies": {
"autoprefixer": "^8.0.0",
"browser-sync": "^2.18.13",
"bs-html-injector": "^3.0.3",
"cssnano": "^4.0.0-rc.2",
"del": "^3.0.0",
"gulp": "^3.9.1",
"gulp-changed": "^3.2.0",
"gulp-concat": "^2.6.1",
"gulp-if": "^2.0.2",
"gulp-newer": "^1.4.0",
"gulp-notify": "^3.2.0",
"gulp-nunjucks-render": "^2.2.2",
"gulp-plumber": "^1.2.0",
"gulp-postcss": "^7.0.0",
"gulp-purgecss": "^0.15.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^11.1.0",
"postcss-load-plugins": "^2.3.0",
"postcss-mixins": "^6.2.0",
"tailwindcss": "^0.5.1"
}
And created a postcss.config.js
file:
module.exports = (ctx) => ({
plugins: {
postcss-import: {},
postcss-mixins: {},
tailwindcss: { './tailwind.js' },
cssnext: {
browsers: ['last 2 versions']
},
cssnano: ctx.env === 'production' ? {
preset: ['default', {
discardComments: {
removeAll: true,
},
}]
} : false,
}
})
And in my gulpfile.js
I'm calling postcss()
without passing anything in:
gulp.task("css", () => {
return gulp
.src(src.css + "index.css")
.pipe(plumber(onError))
...
.pipe(postcss())
...
});
But when I run things, I get the following error:
Error: Unexpected token -
{ /path/to/site/postcss.config.js:3
postcss-import: {},
^
...
Any suggestions as to what I'm missing?
Branch | Build failing π¨ |
---|---|
Dependency | cssnano |
Current Version | 3.8.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As cssnano is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 8 commits .
ef76780
3.8.1
1b779e5
Update changelog.
a4cac25
Add an example for Runkit.
7a0b894
chore(package): update ava to version 0.17.0
d21106f
Update build script.
c05dcd3
Workaround for MoOx/phenomic#732.
2ad9e47
Refactor fixture tests.
34ca2f3
Tidy up tests.
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Make postcss plugins load from postcss.config.js
with a Gulp 4 task and gulp-postcss
. Is there a way?
My simply gulp 4 postcss task
export const pcss = (done) => {
return gulp.src(`${pkg.paths.elements}/**/*.pcss`)
.pipe(postcss(->PLUGINS<-))
.pipe(gulp.dest('./'));
done();
}
gulp.task('postcss', pcss);
Please provide information about your environment.
OS | Node | npm | PostCSS |
---|---|---|---|
Mac OS | 9.2.1 | 5.6.0 | 4.1.1 |
Branch | Build failing π¨ |
---|---|
Dependency | postcss-sprites |
Current Version | 4.0.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As postcss-sprites is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 7 commits .
9af4fe6
Bump v4.1.0
8cb146f
Update 'stylesheetPath' option in README
b7d3019
Merge pull request #73 from evandavis/file-relative-sprites
1d0c2b3
Merge pull request #70 from niksy/issue-66
e910a7c
locate sprites relative to the stylesheet
a7021b4
Add 'originalUrl' property to the image object
131f06b
Add support for Promises in "onSaveSpritesheet"
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
For some reason postcss-load-plugins doesnβt work with postcss-cli in my configuratin. Am I missing something?
Here is my package.json:
{
"scripts": {
"watch:js": "watchify -vd -e app/views/js/index.js -o public_html/assets/index.js",
"watch:css": "postcss -w -o public_html/assets/index.css app/views/css/index.css",
"watch": "npm-run-all --parallel watch:js watch:css"
},
"dependencies": {
"normalize.css": "^4.2.0",
"jquery": "^3.1.0",
"vue": "^2.0.0-rc.2",
"nouislider": "^8.5.1",
"swiper": "^3.3.1",
"malihu-custom-scrollbar-plugin": "^3.1.5"
},
"devDependencies": {
"browserify": "^13.1.0",
"watchify": "^3.7.0",
"babel-core": "^6.13.2",
"babel-preset-es2015": "^6.13.2",
"babelify": "^7.3.0",
"vueify": "^9.2.3",
"uglify-js": "^2.7.1",
"postcss-cli": "^2.5.2",
"postcss-cssnext": "^2.7.0",
"postcss-import": "^8.1.2",
"postcss-load-plugins": "^2.0.0-alpha4",
"postcss-url": "^5.1.2",
"cross-env": "^2.0.0",
"npm-run-all": "^2.3.0"
},
"browserify": {
"transform": [
"vueify",
"babelify"
]
},
"babel": {
"presets": ["es2015"]
},
"postcss": {
"plugins": {
"postcss-import": false,
"postcss-cssnext": false,
"postcss-url": false
}
}
}
Now trying to start: npm run watch:css
. Here is the output:
> @ watch:css
> postcss -w -o public_html/assets/index.css app/views/css/index.css
Usage: /usr/bin/nodejs node_modules/.bin/postcss [--use|-u] plugin [--config|-c
config.json] [--output|-o output.css] [input.css]
[...]
Please specify at least one plugin name.
npm ERR! Linux 4.4.0-34-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch:css"
npm ERR! node v6.4.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! @ watch:css: `postcss -w -o public_html/assets/index.css app/views/css/index.css`
npm ERR! Exit status 1
[...]
Iβve also tried to specify postcss-load-plugins as a plugin in command line (postcss -u postcss-load-plugins
), but it does not work either.
Thank you in advance.
Branch | Build failing π¨ |
---|---|
Dependency | standard |
Current Version | 8.5.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As standard is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 10 commits .
3f88a12
8.6.0
b771408
changelog
4c82bc8
Remove standard-format references
938dcc3
[email protected]
21f0ca4
cross-spawn@5
451da5f
[email protected]
f27f1df
[email protected]
e542e03
[email protected]
66f1ead
Merge pull request #684 from capaj/patch-2
a0280a9
added vscode-standardjs-snippets
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Nothing happens when config is missing
For example if i try to do this:
var pluginsrc = require('postcss-load-plugins')()
pluginsrc.then( function(plugins) {
console.log(plugins);
})
i will not get an error or anything else.
@ai
Branch | Build failing π¨ |
---|---|
Dependency | postcss |
Current Version | 6.0.14 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
postcss is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
from
option on process().then()
call.There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Yet autoprefixer
doesn't work. See here
Branch | Build failing π¨ |
---|---|
Dependency | cosmiconfig |
Current Version | 2.1.0 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
As cosmiconfig is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
The new version differs by 3 commits .
833385b
Prepare 2.1.1
6c4a1c7
Merge pull request #47 from davidtheclark/no-graceful-fs
de81cf6
Remove graceful-fs
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency | postcss |
Current Version | 5.2.5 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As postcss is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
postcss.vendor
for values with spaces (by @gucong3000).There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency | postcss-cssnext |
Current Version | 2.9.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As postcss-cssnext is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
system-ui
keyword to define current System font-sizeThe new version differs by 8 commits .
6577f6c
2.10.0
951b81d
Added: new deactivation rules in features map (#345)
fe6d852
Merge pull request #342 from JLHwung/add-postcss-font-family-system-ui
cf5a472
feat(font-family-system-ui): add to playground example
af96203
feat(font-family-system-ui): add feature to the source
711bcab
feat(font-family-system-ui): add dependency
bc70661
feat(font-family-system-ui): add feature docs
cf304ac
feat(font-family-system-ui): add test fixtures
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency | postcss |
Current Version | 5.2.11 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As postcss is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
module.exports = () => {
return {
plugins: [
require('postcss-import')()
ctx.env === 'production' ? require('cssnano')() : false
]
}
}
- var plugins = config.plugins
+ var plugins = config.plugins.filter(Boolean)
Branch | Build failing π¨ |
---|---|
Dependency | postcss-sprites |
Current Version | 4.1.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As postcss-sprites is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 6 commits .
68d6e97
Bump v4.2.0
2bc5d7a
Add verbose
option
2142930
Fix typoe in the 'Skip Prefix' example
b11b6b2
Fix warning about rejected promise without an error
78161c3
Merge pull request #78 from koppthe/fix-extract-url
a9f0c08
Fix 'getImageUrl' function
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
When a CLI tool which uses this module is installed globally, it's supposed to find plugins in current working directory instead of the directory where the CLI is installed.
If I'm not mistaken, change require(plugin)
to requireCwd(plugin)
(https://github.com/sindresorhus/req-cwd) could solve this.
I am using PostCSS like this:
const gulp = require('gulp')
const $ = require('gulp-load-plugins')()
const config = require('../gulp-config.js')
const postCSSPlugins = {
postcssWillChange: require('postcss-will-change'),
autoprefixer: require('autoprefixer'),
postcssAssets: require('postcss-assets'),
β¦
}
const postcssConfig = {
postcss: [
postCSSPlugins.postcssWillChange,
postCSSPlugins.autoprefixer,
postCSSPlugins.postcssAssets({
loadPaths: [config.serve],
β¦
}),
β¦
]
}
gulp.task('styles', () => {
return gulp.src(config.stylesToCompile)
.pipe($.sourcemaps.init())
.pipe($.postcss(postcssConfig))
.pipe($.sourcemaps.write('.', {sourceRoot: config.stylesFolder}))
.pipe(gulp.dest(config.serve))
})
How to use postcss-load-plugins
in βgulpβ way?
I am tried something like this:
const postCSSPlugins = require('postcss-load-plugins')
const postcssConfig = {
postcss: {
plugins: postCSSPlugins({
'postcss-will-change': {},
'autoprefixer': {},
'postcss-assets': {
loadPaths: [config.serve]
},
β¦
})
}
}
But it's broken:
/usr/local/bin/node /Users/grawl/Sites/β¦/node_modules/gulp/bin/gulp.js --color --gulpfile /Users/grawl/Sites/β¦/gulpfile.js styles
[11:54:40] Using gulpfile ~/Sites/β¦/gulpfile.js
[11:54:40] Starting 'styles'...
[11:54:40] 'styles' errored after 124 ms
[11:54:40] Error in plugin 'gulp-postcss'
Message:
Please provide array of postcss processors!
With similar plugins like posthtml-load-plugins
or rollup-load-plugins
, I do this:
const postHTMLPlugins = require('posthtml-load-plugins')
const posthtmlConfig = {
plugins: postHTMLPlugins({
'posthtml-bem': {
elemPrefix: '-',
modPrefix: '_',
modDlmtr: '-'
}
})
}
const rollupPlugins = require('rollup-load-plugins')()
const rollupConfig = {
β¦
plugins: [
rollupPlugins.sourcemaps({loadMaps: true}),
rollupPlugins.includepaths({
β¦
}),
β¦
]
}
But how to use postcss-load-plugins
with gulp?
The provided configuration from https://github.com/postcss/postcss-loader for the postcss.config.js file is the following:
module.exports = ({ file, options, env }) => {
return {
parser: file.extname === '.sss' ? 'sugarss' : false,
plugins: {
'postcss-import': { root: file.dirname },
'postcss-cssnext': options.cssnext ? options.cssnext : false,
'autoprefixer': env == 'production' ? options.autoprefixer : false,
'cssnano': env === 'production' ? options.cssnano : false
}
};
}
While i'm using the above configuration and i try to do npm run watch, it works pretty well, but when i try to do npm run production i receive the following errors:
ERROR Failed to compile with 8 errors 10:10:47
error in ./~/toastr/toastr.less
Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
@ ./~/toastr/toastr.less 4:14-154
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss ./~/bootstrap-less/bootstrap/bootstrap.less ./resources/assets/less/adminlte-app.less ./~/toastr/toastr.less
error in ./~/bootstrap-less/bootstrap/bootstrap.less
Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
@ ./~/bootstrap-less/bootstrap/bootstrap.less 4:14-163
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss ./~/bootstrap-less/bootstrap/bootstrap.less ./resources/assets/less/adminlte-app.less ./~/toastr/toastr.less
error in ./resources/assets/less/adminlte-app.less
Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
@ ./resources/assets/less/adminlte-app.less 4:14-217
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss ./~/bootstrap-less/bootstrap/bootstrap.less ./resources/assets/less/adminlte-app.less ./~/toastr/toastr.less
error in ./resources/assets/sass/app.scss
Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
@ ./resources/assets/sass/app.scss 4:14-267
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss ./~/bootstrap-less/bootstrap/bootstrap.less ./resources/assets/less/adminlte-app.less ./~/toastr/toastr.less
error in ./resources/assets/sass/app.scss
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
at runLoaders (/home/matheus/Repositorios/fidelidade-online/node_modules/webpack/lib/NormalModule.js:192:19)
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Promise.resolve.then.then.catch (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-loader/lib/index.js:189:71)
at <anonymous>
error in ./~/bootstrap-less/bootstrap/bootstrap.less
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
at runLoaders (/home/matheus/Repositorios/fidelidade-online/node_modules/webpack/lib/NormalModule.js:192:19)
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Promise.resolve.then.then.catch (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-loader/lib/index.js:189:71)
at <anonymous>
error in ./resources/assets/less/adminlte-app.less
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
at runLoaders (/home/matheus/Repositorios/fidelidade-online/node_modules/webpack/lib/NormalModule.js:192:19)
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Promise.resolve.then.then.catch (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-loader/lib/index.js:189:71)
at <anonymous>
error in ./~/toastr/toastr.less
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at load (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:42:38)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:66:18
at Array.forEach (<anonymous>)
at plugins (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-plugins/lib/plugins.js:65:8)
at /home/matheus/Repositorios/fidelidade-online/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
at runLoaders (/home/matheus/Repositorios/fidelidade-online/node_modules/webpack/lib/NormalModule.js:192:19)
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/home/matheus/Repositorios/fidelidade-online/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Promise.resolve.then.then.catch (/home/matheus/Repositorios/fidelidade-online/node_modules/postcss-loader/lib/index.js:189:71)
at <anonymous>
Asset Size Chunks Chunk Names
/js/app.9be25d8d3599f636ed1a.js 352 kB 0 [emitted] [big] /js/app
/js/app-landing.4e4cffbf4f5d977096ec.js 216 kB 1 [emitted] /js/app-landing
/js/app.9be25d8d3599f636ed1a.js.map 362 kB 0 [emitted] /js/app
/js/app-landing.4e4cffbf4f5d977096ec.js.map 221 kB 1 [emitted] /js/app-landing
mix-manifest.json 4.63 kB [emitted]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/matheus/.npm/_logs/2017-12-08T12_10_48_182Z-debug.log
I looked at the file: /node_modules/postcss-load-plugins/lib/plugins.js
And i noticed that on the following if statement:
if (options === null || Object.keys(options).length === 0)
Its being tested only if the options object is null, if the object is not null it tries to
look at the keys of the object, but i believe that its being forgotten the case when the options object is undefined.
I changed my postcss.config.js to the following code:
module.exports = ({ file, options, env }) => {
env = env || {};
file = file || {};
options = options || {};
options.cssnext = options.cssnext || null;
options.autoprefixer = options.autoprefixer || null;
options.cssnano = options.cssnano || null;
return {
parser: file.extname === '.sss' ? 'sugarss' : false,
plugins: {
'postcss-import': { root: file.dirname },
'postcss-cssnext': options.cssnext ? options.cssnext : false,
'autoprefixer': env == 'production' ? options.autoprefixer : false,
'cssnano': env === 'production' ? options.cssnano : false
}
};
}
And now both npm run watch and npm run production are working.
I don't know if any environment configuration could be useful, if someone need some just ask for it and i'll give it.
Thanks for your attention.
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.