We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
微信小程序
https://nervjs.github.io/taro/docs/config-detail/#miniwebpackchain
// 根据文档 webpackChain(chain, webpack) { chain.merge({ module: { rules: { myloader: { test: /\.md$/, use: [{ loader: 'raw-loader', options: {} }] } } } }) console.log(chain.toConfig().module); }
mini.webpackChain 中 module 对象使用 rules 属性,无对 .md 文件处理的 loader 配置
.md
{ rules: [ { test: /\.sass$/, oneOf: [Array] }, { test: /\.scss$/, oneOf: [Array] }, { test: /\.less$/, oneOf: [Array] }, { test: /\.styl$/, oneOf: [Array] }, { test: /\.(css|wxss|acss|ttss)(\?.*)?$/, oneOf: [Array] }, { test: /\.[tj]sx?$/i, include: [Array], use: [Array] }, { test: /\.(wxml|axml|ttml|qml|swan|jxml)(\?.*)?$/, use: [Array] }, { test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, use: [Array] }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, use: [Array] }, { test: /\.(png|jpe?g|gif|bpm|svg|webp)(\?.*)?$/, use: [Array] } ] }
mini.webpackChain 中 module 对象使用 rule 属性
webpackChain(chain, webpack) { chain.merge({ module: { // 由 rules 改成 rule rule: { myloader: { test: /\.md$/, use: [{ loader: 'raw-loader', options: {} }] } } } }) console.log(chain.toConfig().module); }
有对 .md 文件处理的 loader 配置
{ rules: [ { test: /\.sass$/, oneOf: [Array] }, { test: /\.scss$/, oneOf: [Array] }, { test: /\.less$/, oneOf: [Array] }, { test: /\.styl$/, oneOf: [Array] }, { test: /\.(css|wxss|acss|ttss)(\?.*)?$/, oneOf: [Array] }, { test: /\.[tj]sx?$/i, include: [Array], use: [Array] }, { test: /\.(wxml|axml|ttml|qml|swan|jxml)(\?.*)?$/, use: [Array] }, { test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, use: [Array] }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, use: [Array] }, { test: /\.(png|jpe?g|gif|bpm|svg|webp)(\?.*)?$/, use: [Array] }, { test: /\.md$/, use: [Array] } ] }
webpack-chain v4.9.0 文档中 merge 配置可选项:https://www.npmjs.com/package/webpack-chain/v/4.9.0#merging-config 源码:https://github.com/neutrinojs/webpack-chain/blob/v4/src/Config.js
👽 Taro v3.0.5 Taro CLI 3.0.5 environment info: System: OS: macOS 10.14.4 Shell: 5.3 - /bin/zsh Binaries: Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node Yarn: 1.15.2 - ~/.nvm/versions/node/v10.15.3/bin/yarn npm: 6.12.1 - ~/.nvm/versions/node/v10.15.3/bin/npm npmPackages: @tarojs/cli: 3.0.5 => 3.0.5 @tarojs/components: 3.0.5 => 3.0.5 @tarojs/taro: 3.0.5 => 3.0.5 @tarojs/webpack-runner: 3.0.5 => 3.0.5 eslint-config-taro: 3.0.5 => 3.0.5 eslint-plugin-taro: 2.1.4 => 2.1.4 react: ^16.13.1 => 16.13.1 npmGlobalPackages: typescript: 3.5.3
The text was updated successfully, but these errors were encountered:
欢迎 PR~
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
相关平台
微信小程序
复现步骤
https://nervjs.github.io/taro/docs/config-detail/#miniwebpackchain
实际结果
mini.webpackChain 中 module 对象使用 rules 属性,无对
.md
文件处理的 loader 配置期望结果
mini.webpackChain 中 module 对象使用 rule 属性
有对
.md
文件处理的 loader 配置原因
webpack-chain v4.9.0 文档中 merge 配置可选项:https://www.npmjs.com/package/webpack-chain/v/4.9.0#merging-config
源码:https://github.com/neutrinojs/webpack-chain/blob/v4/src/Config.js
环境信息
The text was updated successfully, but these errors were encountered: