Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack #9

Open
ljg601105597 opened this issue Jul 12, 2017 · 3 comments
Open

webpack #9

ljg601105597 opened this issue Jul 12, 2017 · 3 comments

Comments

@ljg601105597
Copy link

怎么嵌入高清方案

@Molin123
Copy link
Owner

Molin123 commented Jul 13, 2017

@ljg601105597 通过在html头部引入一段js脚本来动态的设置viewport

@cz2013
Copy link

cz2013 commented Aug 31, 2017

我在webpack2中使用
{
test: /.less$/,
// use: ['style-loader', 'css-loader', 'less-loader'], // 将css打包到js里面
// 将css单独打包,需要plugins
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
//resolve-url-loader may be chained before lesss-loader if necessary
use: [
'css-loader',
'less-loader',
{
loader: 'postcss-loader',
options: {
plugins:(loader) => [
pxtorem({ // 高清方案,将px转换为rem
rootValue: 100,
propWhiteList: [],
})
]
}
}
]
})
}
这种方式报错:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration.resolve has an unknown property 'modulesDirectories'. These properties are valid:
    object { alias?, aliasFields?, cachePredicate?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSyst
    em?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
  • configuration.resolve.extensions[0] should not be empty.
    但是我需要使用你们用的这种方式,根据不同的路径进行不同的plugins参数配置。
    请问有什么解决方法吗?还是升级到webpack3才可以???

@Molin123
Copy link
Owner

@cz2013 建议升级到3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants