| // ******************************************************************************* |
| // * Copyright (c) 2016 Gigatronik Ingolstadt GmbH |
| // * All rights reserved. This program and the accompanying materials |
| // * are made available under the terms of the Eclipse Public License v1.0 |
| // * which accompanies this distribution, and is available at |
| // * http://www.eclipse.org/legal/epl-v10.html |
| // * |
| // * Contributors: |
| // * Dennis Schroeder - initial implementation |
| // ******************************************************************************* |
| var webpack = require('webpack'); |
| var HtmlWebpackPlugin = require('html-webpack-plugin'); |
| var ExtractTextPlugin = require('extract-text-webpack-plugin'); |
| var helpers = require('./helpers'); |
| |
| module.exports = { |
| entry: { |
| 'polyfills': './app/polyfills.ts', |
| 'vendor': './app/vendor.ts', |
| 'app': './app/main.ts' |
| }, |
| |
| resolve: { |
| extensions: ['', '.js', '.ts'] |
| }, |
| |
| module: { |
| loaders: [ |
| { |
| test: /\.ts$/, |
| loader: 'ts' |
| }, |
| { |
| test: /\.html$/, |
| loader: 'html' |
| }, |
| { |
| test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, |
| loader: 'file?name=assets/[name].[hash].[ext]' |
| }, |
| { |
| test: /\.css$/, |
| exclude: helpers.root('src', 'app'), |
| loader: ExtractTextPlugin.extract('style', 'css?sourceMap') |
| }, |
| { |
| test: /\.css$/, |
| include: helpers.root('src', 'app'), |
| loader: 'raw' |
| } |
| ] |
| }, |
| |
| plugins: [ |
| new webpack.optimize.CommonsChunkPlugin({ |
| name: ['app', 'vendor', 'polyfills'] |
| }), |
| |
| new HtmlWebpackPlugin({ |
| template: 'index.html' |
| }) |
| ] |
| }; |