[英]Migrate giant Typescript application to use webpack
I have a giant Typescript application (~700 files) that uses gulp to basically concat all the files then compile into ES5. 我有一个巨大的Typescript应用程序(约700个文件),该应用程序使用gulp基本上连接了所有文件,然后编译为ES5。
Simplified example: 简化示例:
gulp.task(
'ts',
function () {
var tsResult = gulp.src(ts_glob, { base: './js' })
.pipe(sourcemaps.init())
.pipe(tsProject());
return tsResult.js
.pipe(sourcemaps.write())
.pipe(gulp.dest('./'))
});
I want to start using some of Webpack's functionality and take advantage of modular javascript using import, but I can't find a way to "baby step" this process. 我想开始使用Webpack的某些功能,并通过导入使用模块化javascript,但是我找不到找到“婴儿”的方法。 As soon as use import that file's code is no longer available to the rest of the gulp based code.
一旦使用import,该文件的代码将不再对其他基于gulp的代码可用。
This may not even be a webpack problem really. 这实际上可能甚至不是webpack的问题。 If I could just get away from globbing all the files into one giant file and start using import that would be a huge win.
如果我可以避免将所有文件都放到一个大文件中并开始使用import,那将是一个巨大的胜利。
Is there anyway to piece meal this together so that I don't have to overhaul the whole app at one time? 无论如何,有没有一起做这件事,这样我就不必一次检查整个应用程序了?
Always think of the answer after I ask, and it's so simple 我问完之后,总是想想答案,这很简单
angular.module('project', ['project.new']);
angular.module('project', ['project.new']);
Now you can just move one section or file at a time. 现在,您一次只能移动一个部分或文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.