2019-10-26 18:07:36 +02:00
|
|
|
var Encore = require('@symfony/webpack-encore');
|
2026-04-09 12:10:37 +02:00
|
|
|
var webpack = require('webpack');
|
2016-10-01 21:49:15 +02:00
|
|
|
|
2019-10-27 13:35:33 +01:00
|
|
|
// Manually configure the runtime environment if not already configured yet by the "encore" command.
|
|
|
|
|
// It's useful when you use tools that rely on webpack.config.js file.
|
|
|
|
|
if (!Encore.isRuntimeEnvironmentConfigured()) {
|
|
|
|
|
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// the project directory where compiled assets will be stored
|
2019-10-26 18:07:36 +02:00
|
|
|
Encore
|
|
|
|
|
.setOutputPath('public/build/')
|
|
|
|
|
// the public path used by the web server to access the previous directory
|
|
|
|
|
.setPublicPath('/build')
|
2019-10-27 13:35:33 +01:00
|
|
|
|
|
|
|
|
// .cleanupOutputBeforeBuild()
|
|
|
|
|
.enableBuildNotifications()
|
2019-10-26 18:07:36 +02:00
|
|
|
.enableSourceMaps(!Encore.isProduction())
|
|
|
|
|
// uncomment to create hashed filenames (e.g. app.abc123.css)
|
2019-10-27 13:35:33 +01:00
|
|
|
.enableVersioning(Encore.isProduction())
|
|
|
|
|
|
|
|
|
|
// .copyFiles([
|
|
|
|
|
// {from: './public/bundles/goswebsocket/', to: '/[path][name].[ext]', pattern: /\.(js|css|map)$/, includeSubdirectories: false},
|
|
|
|
|
// ])
|
2016-11-24 23:41:40 +01:00
|
|
|
|
2019-10-26 18:07:36 +02:00
|
|
|
// uncomment to define the assets of the project
|
|
|
|
|
// .addEntry('js/app', './assets/js/app.js')
|
|
|
|
|
// .addStyleEntry('css/app', './assets/css/app.scss')
|
|
|
|
|
|
2019-10-27 13:35:33 +01:00
|
|
|
// .addEntry('mineseeker', ['babel-polyfill', './assets/js/mine-seeker.js'])
|
|
|
|
|
.addEntry('mineseeker', './assets/js/mine-seeker.js')
|
|
|
|
|
.addEntry('mineseekerStyle', './assets/css/style.mineseeker.scss')
|
|
|
|
|
.addEntry('homeStyle', './assets/css/style.layout.scss')
|
|
|
|
|
|
2019-10-26 18:07:36 +02:00
|
|
|
// uncomment if you use Sass/SCSS files
|
2026-04-09 12:10:37 +02:00
|
|
|
.enableSassLoader(options => {
|
|
|
|
|
options.api = 'modern';
|
|
|
|
|
options.sassOptions = { silenceDeprecations: ['import'] };
|
|
|
|
|
})
|
|
|
|
|
.configureCssLoader(options => {
|
|
|
|
|
// don't process absolute URLs (e.g. /images/...) — served by the web server
|
|
|
|
|
options.url = { filter: url => !url.startsWith('/') };
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// provide $/jQuery as global variables for Bootstrap 3 and legacy code
|
|
|
|
|
.addPlugin(new webpack.ProvidePlugin({
|
|
|
|
|
$: 'jquery',
|
|
|
|
|
jQuery: 'jquery',
|
|
|
|
|
'window.jQuery': 'jquery',
|
|
|
|
|
}))
|
2019-10-27 13:35:33 +01:00
|
|
|
|
|
|
|
|
// .configureBabel(function (babelConfig) {
|
|
|
|
|
// babelConfig.presets.push('env');
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
.enableReactPreset()
|
|
|
|
|
|
|
|
|
|
// .enableSingleRuntimeChunk()
|
|
|
|
|
.disableSingleRuntimeChunk()
|
2019-10-26 18:07:36 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
|
|
module.exports = Encore.getWebpackConfig();
|