-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
44 lines (38 loc) · 1.21 KB
/
webpack.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
const Encore = require('@symfony/webpack-encore');
const { resolve } = require('path');
/*
let prefix = process.env.prefix;
if (undefined === prefix) {
prefix = "";
} else {
prefix = prefix.replace(/^\/+/, '').replace(/\/+$/, '') + '/';
}
*/
Encore
.setOutputPath('public/build')
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.enableVueLoader(() => {}, { runtimeCompilerBuild: false })
.enableSassLoader()
.enableTypeScriptLoader(options => {
// options.appendTsSuffixTo = [/\.vue$/];
options.transpileOnly = true;
// options.configFile = 'tsconfig.json';
})
.enableSingleRuntimeChunk()
.copyFiles({ from: './assets/flags', pattern: /\.svg$/, to: 'flags/[name].[ext]'})
.copyFiles({ from: './maps', pattern: /\.(svg|data)$/, to: 'maps/[name].[ext]'})
.addEntry('app', resolve(__dirname, '/src/app.ts'))
// .addEntry('app', resolve(__dirname, '/src/t.ts'))
.configureCssMinimizerPlugin(options => {
options.minimizerOptions = {
preset: [
'default',
{
mergeLonghand: false,
},
],
};
})
;
module.exports = Encore.getWebpackConfig();