sforkowany z mirror/soapbox
Webpack: Reduce to one entrypoint, app/application.js
rodzic
badd64571f
commit
da3e63596b
|
@ -0,0 +1,10 @@
|
|||
import loadPolyfills from './soapbox/load_polyfills';
|
||||
import { start } from './soapbox/common';
|
||||
|
||||
start();
|
||||
|
||||
loadPolyfills().then(() => {
|
||||
require('./soapbox/main').default();
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
});
|
|
@ -1,10 +0,0 @@
|
|||
import loadPolyfills from '../soapbox/load_polyfills';
|
||||
import { start } from '../soapbox/common';
|
||||
|
||||
start();
|
||||
|
||||
loadPolyfills().then(() => {
|
||||
require('../soapbox/main').default();
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
});
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
default: &default
|
||||
source_path: app
|
||||
source_entry_path: packs
|
||||
public_root_path: static
|
||||
public_output_path: packs
|
||||
cache_path: tmp/cache/webpacker
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
// Note: You must restart bin/webpack-dev-server for changes to take effect
|
||||
|
||||
const webpack = require('webpack');
|
||||
const { basename, dirname, join, relative, resolve } = require('path');
|
||||
const { sync } = require('glob');
|
||||
const { basename, join, resolve } = require('path');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const AssetsManifestPlugin = require('webpack-assets-manifest');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
@ -12,18 +11,9 @@ const { env, settings, themes, output } = require('./configuration');
|
|||
const rules = require('./rules');
|
||||
const localePackPaths = require('./generateLocalePacks');
|
||||
|
||||
const extensionGlob = `**/*{${settings.extensions.join(',')}}*`;
|
||||
const entryPath = join(settings.source_path, settings.source_entry_path);
|
||||
const packPaths = sync(join(entryPath, extensionGlob));
|
||||
|
||||
module.exports = {
|
||||
entry: Object.assign(
|
||||
packPaths.reduce((map, entry) => {
|
||||
const localMap = map;
|
||||
const namespace = relative(join(entryPath), dirname(entry));
|
||||
localMap[join(namespace, basename(entry, extname(entry)))] = resolve(entry);
|
||||
return localMap;
|
||||
}, {}),
|
||||
{ application: resolve('app/application.js') },
|
||||
localePackPaths.reduce((map, entry) => {
|
||||
const localMap = map;
|
||||
localMap[basename(entry, extname(entry, extname(entry)))] = resolve(entry);
|
||||
|
|
Ładowanie…
Reference in New Issue