代码拉取完成,页面将自动刷新
同步操作将从 slince/PHPDish 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const Encore = require('@symfony/webpack-encore');
const path = require('path');
const glob = require('glob');
const buildPath = 'web/build';
const config = {
buildPath: path.resolve(buildPath),
assetsPath: path.resolve("./assets"),
cssPath: path.resolve("./assets/css"),
scssPath: path.resolve("./assets/scss"),
jsPath: path.resolve("./assets/js"),
modulesPath: path.resolve("./assets/modules"),
pluginsPath: path.resolve("./assets/plugins"),
mapPath: path.resolve(buildPath + '/manifest.json')
};
Encore
.setOutputPath(buildPath)
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.autoProvidejQuery()
.enableSassLoader()
.enableVersioning(true)
.enableSourceMaps(!Encore.isProduction())
.configureUglifyJsPlugin(function(options){
"use strict";
options.comments = false;
})
.addAliases({
css: config.cssPath,
js: config.jsPath,
module: config.modulesPath,
plugin: config.pluginsPath
})
.autoProvideVariables({
'$': 'jquery',
'jQuery': 'jquery',
"window.jQuery": "jquery",
'_': 'lodash',
"window.lodash": "lodash"
})
.addExternals({
'jquery': 'window.$',
'jQuery': 'window.$',
'lodash': 'window._',
})
.addRule({
test: /\.njk$/,
loader: 'nunjucks-loader'
});
if (!Encore.isProduction()) {
Encore.enableVersioning(false);
Encore.setPublicPath('http://127.0.0.1:8089')
.setManifestKeyPrefix('build/');
}
//add js entries
function findEntries(entryPath){
const entries = {};
const srcDirName = entryPath + '/**/*.js';
glob.sync(srcDirName).forEach(function (filepath) {
const name = filepath.slice(filepath.indexOf('js'), -3);
entries[name] = filepath;
});
return entries;
}
const foundEntries = findEntries(config.jsPath);
for (const entryName in foundEntries) {
Encore.addEntry(entryName, foundEntries[entryName]);
}
//add shared entry
Encore.createSharedEntry('vendor', [
path.resolve(config.modulesPath, 'common.js'),
path.resolve(config.modulesPath, 'dialog.js'),
'highlight.js',
'codemirror',
'codemirror/mode/markdown/markdown.js',
'art-dialog',
'art-dialog/css/dialog.css',
'jquery-validation',
'jquery-pjax',
'bootstrap-select',
'emojione',
'twemoji',
'github-markdown-css',
'bootstrap-select/dist/css/bootstrap-select.min.css',
'codemirror/lib/codemirror.css',
'codemirror/theme/yeti.css',
'simplemde/src/css/simplemde.css',
'social-share-button.js/dist/social-share.min.css',
'highlight.js/styles/tomorrow.css',
'selectize/dist/css/selectize.bootstrap3.css',
'nprogress/nprogress.css',
'loaders.css'
]);
//add style entries
Encore.addStyleEntry('css/style', config.scssPath + '/_all.scss');
Encore.addStyleEntry('css/resume', config.scssPath + '/resume.scss');
Encore.configureUglifyJsPlugin(function(options){
options.comments = true;
});
//final webpack config
module.exports = Encore.getWebpackConfig();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。