forked from maliksahil/SPFxAngularCLI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
38 lines (33 loc) · 1.21 KB
/
gulpfile.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
'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
const path = require('path');
const merge = require('webpack-merge');
const { AngularCompilerPlugin } = require('@ngtools/webpack');
//TODO: factor this out into an npm package
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
console.log(generatedConfiguration)
console.log('generated config', build.getConfig());
Object.assign(generatedConfiguration.resolve, { extensions: ['.ts', '.js'] });
generatedConfiguration.module.rules = [
{ test: /\.ts$/, loader: '@ngtools/webpack' },
{
test: /\.scss$/,
use: ['raw-loader', 'sass-loader']
},
{
test: /\.css$/,
loader: ['raw-loader', 'css-loader']
},
{ test: /\.html$/, loader: 'raw-loader' }
];
generatedConfiguration.plugins.push(new AngularCompilerPlugin({
tsConfigPath: path.resolve('./tsconfig.json')
}))
return generatedConfiguration;
}
});
build.typescript.enabled = false;
build.tslint.enabled = false;
build.initialize(gulp);