This commit is contained in:
mgabdev
2020-03-03 23:59:11 -05:00
parent 33952e424f
commit 143725b5bd
17 changed files with 34 additions and 176 deletions

View File

@@ -8,9 +8,6 @@ const { readFileSync } = require('fs');
const configPath = resolve('config', 'webpacker.yml');
const settings = safeLoad(readFileSync(configPath), 'utf8')[env.RAILS_ENV || env.NODE_ENV];
const themePath = resolve('config', 'themes.yml');
const themes = safeLoad(readFileSync(themePath), 'utf8');
function removeOuterSlashes(string) {
return string.replace(/^\/*/, '').replace(/\/*$/, '');
}
@@ -31,7 +28,6 @@ const output = {
module.exports = {
settings,
themes,
env: {
CDN_HOST: env.CDN_HOST,
NODE_ENV: env.NODE_ENV,

View File

@@ -95,13 +95,13 @@ module.exports = merge(sharedConfig, {
'**/*-webfont-*.svg',
'**/*.woff',
],
// ServiceWorker: {
// entry: `imports-loader?ATTACHMENT_HOST=>${encodeURIComponent(JSON.stringify(attachmentHost))}!${encodeURI(path.join(__dirname, '../../app/javascript/gabsocial/service_worker/entry.js'))}`,
// cacheName: 'gabsocial',
// output: '../assets/sw.js',
// publicPath: '/sw.js',
// minify: true,
// },
ServiceWorker: {
entry: `imports-loader?ATTACHMENT_HOST=>${encodeURIComponent(JSON.stringify(attachmentHost))}!${encodeURI(path.join(__dirname, '../../app/javascript/gabsocial/service_worker/entry.js'))}`,
cacheName: 'gabsocial',
output: '../assets/sw.js',
publicPath: '/sw.js',
minify: true,
},
}),
],
});

View File

@@ -1,8 +1,4 @@
const { join, resolve } = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { settings, themes } = require('../configuration');
let pathy = resolve(join(settings.source_path, themes.default));
module.exports = {
test: /\.s?css$/i,
@@ -12,7 +8,7 @@ module.exports = {
loader: 'css-loader',
options: {
sourceMap: true,
importLoaders: 2,
importLoaders: 1,
modules: true,
localIdentName: '[hash:base64:5]',
},
@@ -23,20 +19,5 @@ module.exports = {
sourceMap: true,
},
},
{
loader: 'sass-loader',
options: {
implementation: require('sass'),
sourceMap: true,
},
},
{
loader: 'sass-resources-loader',
options: {
resources: [
pathy,
]
},
},
],
};

View File

@@ -6,9 +6,12 @@ const { sync } = require('glob');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const AssetsManifestPlugin = require('webpack-assets-manifest');
const extname = require('path-complete-extname');
const { env, settings, themes, output } = require('./configuration');
const { env, settings, output } = require('./configuration');
const rules = require('./rules');
const localePackPaths = require('./generateLocalePacks');
const localePackPaths = [
'/Users/m3/Documents/dev/gab-social/tmp/packs/locale_en.js',
];
//require('./generateLocalePacks');
const extensionGlob = `**/*{${settings.extensions.join(',')}}*`;
const entryPath = join(settings.source_path, settings.source_entry_path);