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
设置脚本后缀支持.ts文件:new WXAppWebpackPlugin({clear:!isDev, scriptExt:'.ts'}) 但entry里还是必须设置app.js为.js后缀:entry: {app: [ './src/app.js']} 问题在以下源代码,写死了app.js:(建议支持动态options.scriptExt) const getEntryFromCompiler = () => { if (typeof entry === 'string') return entry; const appJSRegExp = /\bapp(.js)?$/; const findAppJS = arr => arr.find(path => appJSRegExp.test(path)); if (Array.isArray(entry)) return findAppJS(entry); if (typeof entry === 'object') { for (const key in entry) { if (!entry.hasOwnProperty(key)) continue; const val = entry[key]; if (typeof val === 'string') return val; if (Array.isArray(val)) return findAppJS(val); } } };
The text was updated successfully, but these errors were encountered:
v0.17 57650a3 解决了这个问题,已发布到 npm。
v0.17
新增 extensions 配置选项,通过配置 extensions: ['.ts', '.js'] 可以实现。
extensions
extensions: ['.ts', '.js']
感谢反馈 👍🏿
Sorry, something went wrong.
No branches or pull requests
设置脚本后缀支持.ts文件:new WXAppWebpackPlugin({clear:!isDev, scriptExt:'.ts'})
但entry里还是必须设置app.js为.js后缀:entry: {app: [ './src/app.js']}
问题在以下源代码,写死了app.js:(建议支持动态options.scriptExt)
const getEntryFromCompiler = () => {
if (typeof entry === 'string') return entry;
const appJSRegExp = /\bapp(.js)?$/;
const findAppJS = arr => arr.find(path => appJSRegExp.test(path));
if (Array.isArray(entry)) return findAppJS(entry);
if (typeof entry === 'object') {
for (const key in entry) {
if (!entry.hasOwnProperty(key)) continue;
const val = entry[key];
if (typeof val === 'string') return val;
if (Array.isArray(val)) return findAppJS(val);
}
}
};
The text was updated successfully, but these errors were encountered: