Ionic开发文档

Without `from` option PostCSS could generate wrong source map and will not find Browserslist config

发布时间 2018-5-23 16:03:44   浏览量()   收藏(1)
E:\myvss\AndroidItem\NewEazyApp\newEazyApp>ionic cordova build android
Running app-scripts build: --platform android --target cordova
[08:55:41]  build dev started ...
[08:55:41]  clean started ...
[08:55:41]  clean finished in 12 ms
[08:55:41]  copy started ...
[08:55:42]  deeplinks started ...
[08:55:42]  deeplinks finished in 49 ms
[08:55:42]  transpile started ...
[08:55:50]  transpile finished in 8.05 s
[08:55:50]  preprocess started ...
[08:55:50]  preprocess finished in 2 ms
[08:55:50]  webpack started ...
[08:55:50]  copy finished in 9.16 s
[08:56:04]  webpack finished in 14.00 s
[08:56:04]  sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[08:56:06]  sass finished in 2.20 s
[08:56:06]  postprocess started ...
[08:56:06]  postprocess finished in 11 ms
[08:56:06]  lint started ...
[08:56:06]  build dev finished in 25.28 s
> cordova build android
ANDROID_HOME=F:\ionic\AppData\Local\Android\Sdk
JAVA_HOME=E:\Program Files (x86)\java

错误信息:Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.

解决方法:

在“/node_modules/@ionic/app-scripts/dist/sass.js”路径的“sass.js”文件,在postcssOptions参数中添加“from: undefined”。添加后效果如下:

        var postcssOptions = {
			from: undefined,
            to: path_1.basename(sassConfig.outFile),
            map: autoPrefixerMapOptions
        };


广告会让浏览体验不好,可这是网站的唯一收入,请点击下面的百度广告,支持老高的开源行动吧!