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

44 lines
922 B
JavaScript
Raw Normal View History

2017-05-03 15:35:00 +02:00
/* eslint-disable no-var, strict, prefer-arrow-callback */
'use strict';
var path = require('path');
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: {
loaders: [{
test: /\.ts(x?)$/,
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2016&presets[]=es2015&presets[]=react!ts-loader'
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2016', 'es2015', 'react']
}
}]
},
plugins: [
],
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
};