Skip to content
Snippets Groups Projects
webpack.config.js 925 B
Newer Older
"use strict";
const path = require('path');
const fs = require('fs');

const testAppDir = path.join(__dirname, 'dist/_test');
const outDir = path.join(__dirname, 'test-html/js');
const files = fs.readdirSync(testAppDir);
const entries = {};

Glenn Vorhes's avatar
Glenn Vorhes committed
for (var i = 0; i < files.length; i++) {
    var e = files[i];
    if (e.match(/\.js$/) == null) {
        continue;
    }
    entries[e.replace(/.js/, '')] = path.join(testAppDir, e);
}

module.exports = {
Glenn Vorhes's avatar
Glenn Vorhes committed
    // entry: entries,
        path: outDir,
        filename: "[name].js"
    },
Glenn Vorhes's avatar
Glenn Vorhes committed
    devtool: 'source-map',
    watch: true,
    module: {
        loaders: [
Glenn Vorhes's avatar
Glenn Vorhes committed
            {test: /\.tsx?$/, loader: "ts-loader"}
Glenn Vorhes's avatar
Glenn Vorhes committed
    resolve: {
        extensions: [".ts", ".tsx", ".js", '.jsx']
    },
Glenn Vorhes's avatar
Glenn Vorhes committed
        "jquery": "$",
        "custom-ol": "ol",
        "react": "React",
Glenn Vorhes's avatar
Glenn Vorhes committed
        "react-dom": "ReactDOM",
        "jquery-ui": true