Comments (9)
发下你的webpack config?cli创建项目时是一路回车下来的吗?
from mpx.
检查一下是不是手动往配置里敲了一个‘1’,脚手架生成的配置中不应该存在这种属性
from mpx.
- 项目运行报错
- 模板配置错了
- 数组和对象 merge 成了下标对象这种形式去了
function runWebpack (cfg) {
if (program.production || program.watch) {
cfg = merge(cfg, program.production ? {
mode: 'production'
} : {
cache: true
})
}
if (process.env.npm_config_report) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
var mainCfg = Array.isArray(cfg) ? cfg[0] : cfg
mainCfg.plugins.push(new BundleAnalyzerPlugin())
}
if (program.watch) {
【console.log(cfg)】
webpack(cfg).watch({}, callback)
} else {
webpack(cfg, callback)
}
}
得到
{ '0':
{ module: { rules: [Array] },
output:
{ filename: '[name].js',
path: 'D:\\桌面-copy\\mpxtest\\dist\\plugin' },
optimization: { runtimeChunk: [Object], splitChunks: [Object] },
mode: 'none',
plugins: [ [Object] ],
resolve: { extensions: [Array], modules: [Array] },
entry: { plugin: 'D:\\桌面-copy\\mpxtest\\src\\plugin\\plugin.json' } },
'1':
{ module: { rules: [Array] },
output:
{ filename: '[name].js',
path: 'D:\\桌面-copy\\mpxtest\\dist\\miniprogram' },
optimization: { runtimeChunk: [Object], splitChunks: [Object] },
mode: 'none',
plugins: [ [Object], [Object] ],
resolve: { extensions: [Array], modules: [Array] },
entry: { app: 'D:\\桌面-copy\\mpxtest\\src\\miniprogram\\app.mpx' } },
cache: true }
from mpx.
npm run watch报错了? 为啥npm run build命令是好的呢
from mpx.
@sky-admin @loo41 大佬有正确的模版配置吗
from mpx.
因为build并没有执行这个
cfg = merge(cfg, program.production ? {
mode: 'production'
} : {
cache: true
})
from mpx.
我重新下生成了一下项目 发现 一路回车 在plugins 插件这个选项的时候选择 no 生成的命令
也就是不是插件模式 npm run warch 就没问题
from mpx.
已复现问题,正在解决,正常开发需求一般应该选择非插件模式,我们默认提供的选项也是No。。
from mpx.
已解决。重新init项目即可。
已有项目的修改可参见:mpx-ecology/mpx-template@5d8ce0c
from mpx.
Related Issues (20)
- [Feature Request] CSS 样式的条件编译 在使用预编译(比如SCSS)的时候不支持 HOT 4
- [Bug report] 跨端转百度小程序setup执行报错 HOT 2
- [Bug report] 关于小程序通过 this.properties 获取外部传入参数的问题 HOT 3
- [Bug report]修改数据(对象or数组)后页面未更新 HOT 3
- [Bug report] 数据变化无法更新页面的问题 HOT 1
- [Bug report]跨端转百度小程序执行报错Page not found HOT 2
- i18n多语言 HOT 1
- 有考虑支持skyline引擎进行渲染吗 HOT 1
- 事件名带有连字符-的情况下,无法使用mpx的事件处理内联传参的增强机制 HOT 2
- [Bug report] @mpx/cli 3.x 分包无效
- [Bug report]微信小程序provide/inject使用无效 HOT 1
- [Feature Request] 是否支持入口文件是app.xxx呢 HOT 2
- [Bug report] 构建支付宝小程序后,在开启mpx事件代理的情况下,bindregionchange 事件不触发 HOT 5
- [Bug report] npm run serve 报错Error: Build error HOT 4
- [Bug report] serve web ts报错 HOT 1
- [Bug report] 2.9.x版本 eslint 报错导致 serve 跑不起来 HOT 1
- [Bug report] `onLoad`, `onShow` and so on hooks not found in node_modules/@mpxjs/core/src/index.js HOT 3
- [Bug report] 最新的core类型声明为什么删除了对PropType类型的支持? HOT 1
- [Bug report]optimizeRenderRules 优化导致的bug HOT 2
- [Bug report] 使用setData更新数据时,某些场景会报错:TypeError: Cannot read property 'length' of null HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpx.