Skip to content

Instantly share code, notes, and snippets.

@inxilpro
Last active June 17, 2017 18:34
Show Gist options
  • Save inxilpro/2a41df05a612d7c53c9993da234f7883 to your computer and use it in GitHub Desktop.
Save inxilpro/2a41df05a612d7c53c9993da234f7883 to your computer and use it in GitHub Desktop.
Using ts-loader
const babelOpts = {
'presets': ['react', 'es2015', 'stage-0'],
'plugins': ['syntax-dynamic-import'],
};
const config = {};
config.module = {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|vendor)/,
use: [{
'loader': 'babel-loader',
'options': babelOpts
}]
}, {
test: /\.tsx?$/,
exclude: /(node_modules|vendor)/,
use: [{
'loader': 'babel-loader',
'options': babelOpts,
}, {
'loader': 'ts-loader',
}]
}
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment