wallet-core/node_modules/ts-loader/examples/react-babel-karma-gulp/webpack.config.js

65 lines
1003 B
JavaScript
Raw Normal View History

2017-05-03 15:35:00 +02:00
'use strict';
var path = require('path');
var babelOptions = {
"presets": [
"react",
[
"es2015",
{
"modules": false
}
],
"es2016"
]
};
module.exports = {
cache: true,
entry: {
main: './src/main.tsx',
vendor: [
'babel-polyfill',
'fbemitter',
'flux',
'react',
'react-dom'
]
},
output: {
path: path.resolve(__dirname, './dist/scripts'),
filename: '[name].js',
chunkFilename: '[chunkhash].js'
},
module: {
rules: [{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: babelOptions
},
{
loader: 'ts-loader'
}
]
}, {
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: babelOptions
}
]
}]
},
plugins: [
],
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
};