This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack-app-test.config.js
65 lines (63 loc) · 2.21 KB
/
webpack-app-test.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'use strict';
// Modules
const path = require("path");
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
name: 'app-test',
devtool: 'inline-source-map',
module: {
rules: [
//Preloader
{
test: /\.js$/,
enforce: "pre",
exclude: [
/node_modules/,
/\.spec\.js$/,
/src\/api/
],
loader: 'istanbul-instrumenter-loader',
query: {
esModules: true
}
},
//Delicious ES2015 code, made simple for simpleton browsers.
{
test: /\.js$/,
exclude: /(node_modules|bower_components|src\/api)/,
loader: 'babel-loader',
query: {
presets: ['es2015'],
plugins: [
"transform-async-to-bluebird",
"transform-promise-to-bluebird",
"transform-flow-strip-types",
"transform-runtime"
]
}
},
{ test: /\.css$/, loader: 'null-loader' },
{ test: /\.(json|jsd|jsontxt)$/, loader: "hson-loader" },
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=200000&mimetype=application/font-woff&name=[hash].[ext]" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader?&name=/fonts/[hash].[ext]" },
{ test: /\.(png|jpe?g|gif|ico)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' },
{ test: /\.(html|aspx)$/, loader: 'raw-loader' }
]
},
output: {},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
postcss: [
autoprefixer({
browsers: ['last 2 version']
})
]
}
})
]
};