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

feat: ice-scripts add config override power #38

Merged
merged 3 commits into from
Jan 26, 2018
Merged

Conversation

wssgcg1213
Copy link
Collaborator

@wssgcg1213 wssgcg1213 commented Jan 24, 2018

增加 buildConfig 中定义字段覆盖编译配置的能力

目前支持的:

1. devtool, 指定 sourcemap 类型
2. output: {}, 输出相关配置,  entry 成对,  webpack https://webpack.js.org/concepts/output/
4. externals 
5. entry (已有) https://webpack.js.org/concepts/entry-points/

其他特性修改:

支持 环境变量 PUBLIC_URL, 用来指定 output.publicPath, 逻辑同 create-react-app
add babel-plugin-transfrom-runtime to support regenerator-runtime(MIT)

我会在站点上补充一篇工程自定义的文档

output: Object.assign({
path: paths.appBuild,
filename: '[name].js',
publicPath: '/dist/',
}),
publicPath: buildConfig.publicPath || '/dist/',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publicPath 收敛到 output 里就可以了

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果覆盖了 publicPath 在 dev 模式下就运行不起来了, 只有在发布的时候才需要

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要回归下 dev-server 是否会覆盖这个值

Copy link
Collaborator

@noyobo noyobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output 修改下

@wssgcg1213
Copy link
Collaborator Author

done

regenerator: true,
moduleName: 'babel-runtime',
}],
[babelPluginIce, { libraryName: '@ali/ice' }],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

babelPluginIce 这个插件看下是否可以通用, 同时 @ali 这些可以删除掉了.

publicPath: '/dist/',
}),
publicPath: paths.servedPath,
}, buildConfig.output || {}),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output 的优先级是最高的, 环境变量暂不提供, 容易混淆.

Copy link
Collaborator

@noyobo noyobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

插件与 buildConfig 需要修改

@noyobo noyobo merged commit 725c4ba into ice-scripts Jan 26, 2018
@noyobo noyobo deleted the feat-ice-scripts branch January 26, 2018 05:12
@wssgcg1213 wssgcg1213 mentioned this pull request Jan 29, 2018
8 tasks
chenbin92 pushed a commit that referenced this pull request May 8, 2020
fix: remove export name before add
chenbin92 pushed a commit that referenced this pull request May 9, 2020
fix: remove export name before add
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

Successfully merging this pull request may close these issues.

2 participants