angular2-data-table
Version:
angular2-data-table is a Angular2 component for presenting large and complex data.
97 lines (93 loc) • 2.7 kB
JavaScript
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// const ngtools = require('@ngtools/webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common');
const { ENV, dir, APP_VERSION } = require('./helpers');
const banner =
`/**
* angular2-data-table v${APP_VERSION} (https://github.com/swimlane/angular2-data-table)
* Copyright 2016
* Licensed under MIT
*/`;
module.exports = function(env) {
return webpackMerge(commonConfig({ env: ENV }), {
devtool: 'source-map',
module: {
exprContextCritical: false,
rules: [
{
test: /\.ts$/,
loaders: [
'awesome-typescript-loader'
],
exclude: [/\.(spec|e2e|d)\.ts$/]
},
{
test: /\.css/,
loader:
ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader:'css-loader?sourceMap'
})
},
{
test: /\.scss$/,
loader:
ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader?sourceMap!postcss-loader?sourceMap!sass-loader?sourceMap'
})
}
]
},
entry: {
'index': './src/index.ts'
},
output: {
path: dir('release'),
libraryTarget: 'umd',
library: 'angular2-data-table',
umdNamedDefine: true
},
externals: {
'@angular/platform-browser-dynamic': '@angular/platform-browser-dynamic',
'@angular/platform-browser': '@angular/platform-browser',
'@angular/core': '@angular/core',
'@angular/common': '@angular/common',
'@angular/forms': '@angular/forms',
'core-js': 'core-js',
'core-js/es6': 'core-js/es6',
'core-js/es7/reflect': 'core-js/es7/reflect',
'rxjs': 'rxjs',
'rxjs/Rx': 'rxjs/Rx',
'rxjs/Subscription': 'rxjs/Subscription',
'zone.js/dist/zone': 'zone.js/dist/zone'
},
plugins: [
new ExtractTextPlugin({
filename: '[name].css',
allChunks: true
}),
new webpack.BannerPlugin({
banner: banner,
raw: true,
entryOnly: true
}),
/*
new ngtools.AotPlugin({
tsConfigPath: 'tsconfig-aot.json',
baseDir: dir()
entryModule: dir('datatable.module.ts') + '#Angular2DataTableModule'
}),
new CleanWebpackPlugin(['release'], {
root: dir(),
verbose: false,
dry: false
})
*/
]
});
};