angularjs - Babel + Typescript + NPM Modules + Webpack -
hello try require angular typescript script, , error:
error ts2307: cannot find module 'angular'.
here webpack config file:
context: __dirname + '/client/js', entry: './script.ts', output: { filename: 'build.js', path: options.build ? 'dist' : 'dev' }, module: { loaders: [ {test: /\.ts(x?)$/, loader: 'babel-loader!ts-loader'} ] }
edit:
then, in script.ts file, do:
import angular 'angular';
or var angular = require('angular');
gives me same result
i don't have tsconfig.json file
thank !
i don't have tsconfig.json file
you need tsconfig.json file. see ts-loader readme : https://github.com/typestrong/ts-loader#configuration
example babel
checkout : https://github.com/typestrong/ts-loader/issues/93
Comments
Post a Comment