Skip to content

Commit

Permalink
chore(deps): update dependency kkt to v6.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 26, 2021
1 parent 3628093 commit 47bebfb
Show file tree
Hide file tree
Showing 4 changed files with 8,831 additions and 10,391 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
oscnews*
build*
dist*

.DS_Store
.cache
Expand Down
36 changes: 20 additions & 16 deletions .kktrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import FileManagerPlugin from 'filemanager-webpack-plugin';
import lessModules from '@kkt/less-modules';

export const loaderOneOf = [
require.resolve('@kkt/loader-less')
];

export default (conf) => {
export default (conf, env, options) => {
conf = lessModules(conf, env, options);
conf.output.publicPath = './';
const regexp = /(HotModuleReplacementPlugin)/;

const regexp = /(ReactRefreshWebpackPlugin)/;
conf.plugins = conf.plugins.map((item) => {
if (item.constructor && item.constructor.name && regexp.test(item.constructor.name)) {
return null;
Expand All @@ -18,15 +17,20 @@ export default (conf) => {
conf.plugins.push(new CleanWebpackPlugin({
cleanStaleWebpackAssets: true
}));
conf.plugins.push(new FileManagerPlugin({
onEnd: [{
copy: [
{ source: './chrome-main/manifest.json', destination: './build/manifest.json' },
{ source: './chrome-main/background.js', destination: './build/background.js' },
{ source: './chrome-main/osc-logo.png', destination: './build/osc-logo.png' },
{ source: './src/dev-site/public/icons', destination: './build/icons' },
],
}],
}));

conf.plugins.push(
new FileManagerPlugin({
events: {
onEnd: {
copy: [
{ source: './chrome-main/manifest.json', destination: './dist/manifest.json' },
{ source: './chrome-main/background.js', destination: './dist/background.js' },
{ source: './chrome-main/osc-logo.png', destination: './dist/osc-logo.png' },
{ source: './src/dev-site/public/icons', destination: './dist/icons' },
],
},
},
}),
);
return conf;
}
Loading

0 comments on commit 47bebfb

Please sign in to comment.