daml/navigator/frontend/webpack.ui-core.js
2019-08-13 17:23:03 +01:00

66 lines
1.6 KiB
JavaScript

// Copyright (c) 2019 The DAML Authors. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
const path = require("path");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
module.exports = {
entry: './src/ui-core/src/devel/index.tsx',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.tsx?$/,
enforce: 'pre',
loader: 'tslint-loader',
options: {
emitErrors: true,
}
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'awesome-typescript-loader',
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' },
{ test: /\.(woff|woff2)$/, use: {
loader: 'url-loader',
options: {
name: 'fonts/[hash].[ext]',
limit: 5000,
mimetype: 'application/font-woff'
}
}
},
{ test: /\.(ttf|eot|svg)$/, use: {
loader: 'file-loader',
options: { name: 'fonts/[hash].[ext]' }
}
}
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
plugins: [
new HtmlWebpackPlugin({ template: './src/ui-core/index.html' }),
new CaseSensitivePathsPlugin(),
],
devServer: {
port: 8001,
historyApiFallback: { index: '/' },
compress: true,
}
};