-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Unexpected token export
...\ngw.config.ts:5
export default function (config) {
^^^^^^
SyntaxError: Unexpected token export
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Module.m._compile (D:...\node_modules\ngw\node_modules\ts-node\src\index.ts:400:23)
at Module._extensions..js (module.js:646:10)
at Object.require.extensions.(anonymous function) [as .ts] (D:...\node_modules\ngw\node_modules\ts-node\src\index.ts:403:12)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at NgCliWebpackConfig.webpack_config_1.NgCliWebpackConfig.buildConfig (D:..\node_modules\ngw\lib\index.js:10:27)
at Class.run (D:...\node_modules@angular\cli\tasks\build.js:31:92)
at Class.run (D:...\node_modules@angular\cli\commands\build.js:250:40)
at resolve (D:...\node_modules@angular\cli\ember-cli\lib\models\command.js:261:20)
at new Promise ()
child_process.js:644
throw err;
^
Error: Command failed: node D:...\node_modules\ngw\node_modules\ts-node\dist\bin.js D:...\node_modules\ngw\lib\index.js build --app=web
at checkExecSyncError (child_process.js:601:13)
at execSync (child_process.js:641:13)
at Object. (D:...\node_modules\ngw\bin\ngw:14:9)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ....@0.0.0 build:web: ngw build --app=web
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ....@0.0.0 build:web script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
======= Code from example ========
import * as webpack from 'webpack';
import { WebpackConfigOptions } from '@angular/cli/models/webpack-config';
import { BuildOptions } from '@angular/cli/models/build-options';
const PurifyCSSPlugin = require('purifycss-webpack');
const path = require('path');
const glob = require('glob');
export default function(config: webpack.Configuration) {
config.plugins.push(
new PurifyCSSPlugin({
paths: glob.sync(path.join(__dirname, '**/*.html'))
})
);
return config;
}