65 lines
1003 B
JavaScript
65 lines
1003 B
JavaScript
|
'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']
|
||
|
},
|
||
|
};
|