代码拉取完成,页面将自动刷新
同步操作将从 slince/PHPDish 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const Encore = require('@symfony/webpack-encore');
const path = require('path');
const glob = require('glob');
const buildPath = 'web/build';
Encore
.setOutputPath(buildPath)
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.autoProvidejQuery()
.enableSassLoader()
.autoProvideVariables({
'$': 'jquery',
'jQuery': 'jquery',
"window.jQuery": "jquery",
'_': 'lodash',
"window.lodash": "lodash"
})
.enableVersioning(true)
.enableSourceMaps(!Encore.isProduction());
if (!Encore.isProduction()) {
Encore.enableVersioning(false);
Encore.setPublicPath('http://127.0.0.1:8089')
.setManifestKeyPrefix('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')
};
//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'),
'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',
'emojione',
'twemoji',
'nprogress/nprogress.css',
'loaders.css'
]);
//add style entries
Encore.addStyleEntry('css/style', config.scssPath + '/_all.scss');
Encore.addStyleEntry('css/resume', config.scssPath + '/resume.scss');
//final webpack config
const webpackConfig = Encore.getWebpackConfig();
webpackConfig.resolve.alias = {
css: config.cssPath,
js: config.jsPath,
module: config.modulesPath,
plugin: config.pluginsPath
};
webpackConfig.externals = {
'jquery': 'window.$',
'lodash': 'window._',
};
//add nunjunks loader
webpackConfig.module.rules.push({
test: /\.njk$/,
loader: 'nunjucks-loader'
});
module.exports = webpackConfig;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。