Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 16 2017 07:10
    minerchow edited #202
  • Nov 16 2017 07:10
    minerchow opened #202
  • Nov 14 2017 01:28
    dondevi opened #201
  • Nov 08 2017 07:44
    earlymeme opened #200
  • Nov 08 2017 07:39
    earlymeme closed #199
  • Nov 08 2017 07:26
    earlymeme opened #199
  • Nov 06 2017 09:31
    phaibin opened #198
  • Oct 26 2017 05:53

    QingWei-Li on v1.5.5

    (compare)

  • Oct 26 2017 05:53
    QingWei-Li closed #196
  • Oct 26 2017 05:53

    QingWei-Li on master

    fix: upgrade extract-text-webpa… v1.5.5 (compare)

  • Oct 25 2017 07:34
    leewind opened #197
  • Oct 23 2017 04:09
    tiupcn edited #196
  • Oct 23 2017 04:09
    tiupcn opened #196
  • Oct 17 2017 02:08

    QingWei-Li on v1.5.4

    fix: extract-text-webpack-plugi… v1.5.4 (compare)

  • Oct 17 2017 02:08
    QingWei-Li closed #187
  • Oct 17 2017 02:08

    QingWei-Li on master

    fix: extract-text-webpack-plugi… v1.5.4 (compare)

  • Oct 12 2017 12:00
    shaoxiong789 opened #195
  • Sep 28 2017 07:58
    deepkolos opened #194
  • Sep 28 2017 07:58
    deepkolos opened #193
  • Sep 12 2017 08:28
    KevinLongLong edited #192
cinwell.li
@QingWei-Li
哦是的
这个 url-loader 的一个问题
资源被重复给 url loader 处理了
svg: {
          test: /\.svg(\?\S*)?$/,
          loader: 'url-loader',
          query: {
            limit: limit,
            name: path.posix.join(assetsPath, '[name].[hash:7].[ext]')
          }
        },
        image: {
          test: /\.(gif|png|jpe?g)(\?\S*)?$/,
          loader: 'url-loader',
          query: {
            limit: limit,
            name: path.posix.join(assetsPath, '[name].[hash:7].[ext]')
          }
        }
因为我已经有提供 图片的 loader 了
maywzp
@maywzp
嗯,没提供视频的
cinwell.li
@QingWei-Li
嗯 所以你自己加一个
cooking.add(‘loader.mp4’ {
 test: /\.mp4$/,
loader: ‘url-loader'
})
isunkui
@isunkui
帅锅,1.0版本的cooking,自定义postcss插件,config这个要怎么配置呢
> cooking build -p

[cooking] - Failed to read the config.
[cooking] - TypeError: (cooking.config.postcss || []).concat is not a function
    at module.exports (/Users/isunkui/.cooking/node_modules/cooking-autoprefixer/index.js:6:59)
    at importExtend (/usr/local/lib/node_modules/cooking-cli/util/load-extend.js:11:31)
    at Object.keys.reverse.forEach.key (/usr/local/lib/node_modules/cooking-cli/util/load-extend.js:47:5)
    at Array.forEach (native)
    at module.exports (/usr/local/lib/no
cinwell.li
@QingWei-Li
cooking.set({
  postcss: [
    require('postcss-plugin'),
    require('autoprefixer') // 如果使用 vue-loader^8.0.0 需要手动关掉里面的 autoprefixer
    // xxx
  ]
})

// cooking.add('vue.autoprefixer', false)
cooking-autoprefixer 用不了?
isunkui
@isunkui
还是有些问题,postcss配置的插件没有生效,config如下:
cooking.set({
  postcss: [
    require('postcss-salad')({
      browser: ['> 0.1%', 'iOS 7'],
      features: {
        rem: false,
        autoprefixer: ['> 0.1%', 'iOS 7']
        // 'rem': {rootValue: 75},
        // 'bem': false
      }
    }),
    require('postcss-center'),
    require('postcss-px2rem')({remUnit: 75})
  ],
  extends: ['vue', 'lint', 'saladcss']
});
cinwell.li
@QingWei-Li
saladcss 去掉
配置了 postcss 就不用 saladcss 插件了
两者不共存
isunkui
@isunkui
这个我试过了,但是会有下面的错误
Child cooking.conf.js:

    ERROR in /usr/local/lib/~/cooking-cli/~/css-loader?sourceMap!/Users/isunkui/.cooking/~/vue-loader/lib/style-rewriter.js!/Users/isunkui/.cooking/~/vue-loader/lib/selector.js?type=style&index=0!./src/app.vue
    Module build failed: Error: undefined:1:16: missing '{'
        at error (/Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/css/lib/parse/index.js:62:15)
        at declarations (/Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/css/lib/parse/index.js:247:25)
        at rule (/Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/css/lib/parse/index.js:560:21)
        at rules (/Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/css/lib/parse/index.js:117:70)
        at stylesheet (/Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/css/lib/parse/index.js:81:21)
        at Object.module.exports [as parse] (/Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/css/lib/parse/index.js:564:20)
        at Px2rem.generateRem (/Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/px2rem/lib/px2rem.js:70:20)
        at /Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/postcss-px2rem/lib/index.js:10:32
        at plugins.map.plugin (/usr/local/lib/node_modules/cooking-cli/node_modules/cooking/util/load-postcss.js:11:57)
        at Array.map (native)
        at Object.postcss (/usr/local/lib/node_modules/cooking-cli/node_modules/cooking/util/load-postcss.js:11:22)
        at Object.module.exports (/Users/isunkui/.cooking/node_modules/vue-loader/lib/style-rewriter.js:45:30)
     @ /Users/isunkui/.cooking/~/vue-style-loader!/usr/local/lib/~/cooking-cli/~/css-loader?sourceMap!/Users/isunkui/.cooking/~/vue-loader/lib/style-rewriter.js!/Users/isunkui/.cooking/~/vue-loader/lib/selector.js?type=style&index=0!./src/app.vue 4:14-347 13:2-17:4 14:20-353
     @ ./src/app.vue
     @ ./src/main.js
     @ multi app
cinwell.li
@QingWei-Li
missing ‘{‘ 这个错是啥。。。
isunkui
@isunkui
去掉postcss-px2rem确实是生效了,我用的插件出错了,我在看看
isunkui
@isunkui
引入postcss-pxtorem也报错了,应该还是有些问题的,我还是改用之前的方式了,参考cooking-salad的方式引入了
cinwell.li
@QingWei-Li
抱啥错。。
这里面并没有做啥处理啊 = =
isunkui
@isunkui
Child cooking.conf.js:

    ERROR in /usr/local/lib/~/cooking-cli/~/css-loader?sourceMap!/Users/isunkui/.cooking/~/vue-loader/lib/style-rewriter.js!/Users/isunkui/.cooking/~/vue-loader/lib/selector.js?type=style&index=0!./src/app.vue
    Module build failed: TypeError: css.walkDecls is not a function
        at /Volumes/file/d/workspace/doufan/df-workflow/app/node_modules/postcss-pxtorem/index.js:34:13
        at plugins.map.plugin (/usr/local/lib/node_modules/cooking-cli/node_modules/cooking/util/load-postcss.js:11:57)
        at Array.map (native)
        at Object.postcss (/usr/local/lib/node_modules/cooking-cli/node_modules/cooking/util/load-postcss.js:11:22)
        at Object.module.exports (/Users/isunkui/.cooking/node_modules/vue-loader/lib/style-rewriter.js:45:30)
     @ /Users/isunkui/.cooking/~/vue-style-loader!/usr/local/lib/~/cooking-cli/~/css-loader?sourceMap!/Users/isunkui/.cooking/~/vue-loader/lib/style-rewriter.js!/Users/isunkui/.cooking/~/vue-loader/lib/selector.js?type=style&index=0!./src/app.vue 4:14-347 13:2-17:4 14:20-353
     @ ./src/app.vue
     @ ./src/main.js
     @ multi app
    Child html-webpack-plugin for "index.html":
跟sourceMap有关吗
我将他设为false也有问题
cinwell.li
@QingWei-Li
那你设置 sourceMap: false 被
不清楚啥问题 也有可能是 postcss-salad
你把 salad 放在最后
先用 px2rem 处理
isunkui
@isunkui
有试过,也有这个问题
两个插件,你说的这个方式都试过
我通过下面这种方式调用就没问题
var plugins = [
  require('postcss-salad')({
    browser: ['> 0.1%', 'iOS 7'],
    features: {
      rem: false,
      autoprefixer: ['> 0.1%', 'iOS 7'],
      // 'rem': {rootValue: 75},
      // 'bem': false
    }
  }),
  require('postcss-center'),
  require('postcss-px2rem')({remUnit: 75})
];

cooking.add('postcss', function () {
  return plugins;
});

cooking.add('vue.postcss', function () {
  return plugins;
});
cinwell.li
@QingWei-Li
这样就不报错么
isunkui
@isunkui
是的,这样使用就达到了我预期的效果
cinwell.li
@QingWei-Li
好 我研究下
wltony
@wltony
现在cooking-cli 支持vue 2.0么
cinwell.li
@QingWei-Li
支持啊
只是脚手架我还没更新
明天弄
wltony
@wltony
真勤快,现在用脚手架,需要手动改些啥,不过多话我就先手动改改。
cinwell.li
@QingWei-Li
不需要改啥吧 只是到时候把 vue 和 vue2 两个脚手架合并成一个 然后把新版本的一些特性 postcss 啥的加上去,然后提供一个是否安装本地版本的 cooking 的选项
大致这些
wltony
@wltony
Ok
Janus
@hfxchan
blob
不知道为啥总是报错,第一次弄不懂
cinwell.li
@QingWei-Li
。。。代码问题。。我在修复。。
cinwell.li
@QingWei-Li
@hfxchan 以前有安装过?
Janus
@hfxchan
装过旧版本的
cinwell.li
@QingWei-Li
把 .cooking 目录清理下