refactor: assets

This commit is contained in:
cha0s 2021-03-23 17:24:31 -05:00
parent 0ddde63537
commit 41802a2c9d
14 changed files with 26 additions and 4 deletions

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!/postcss.config.js !/postcss.config.js
!/webpack.config.js !/webpack.config.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!/.neutrinorc.js !/.neutrinorc.js
!/webpack.config.js !/webpack.config.js

View File

@ -1,10 +1,23 @@
const {basename, dirname, extname, join} = require('path'); const {
basename,
dirname,
extname,
join,
} = require('path');
const glob = require('glob'); const glob = require('glob');
const nodeExternals = require('webpack-node-externals'); const nodeExternals = require('webpack-node-externals');
// eslint-disable-next-line no-eval
const R = eval('require');
module.exports = () => (neutrino) => { module.exports = () => (neutrino) => {
neutrino.config.output.path(process.cwd()); neutrino.config.output.path(process.cwd());
const clean = R('@neutrinojs/clean');
clean({
cleanOnceBeforeBuildPatterns: ['assets/**/*'],
pluginId: '@latus/build/assets',
})(neutrino);
const {files = []} = neutrino.options.packageJson; const {files = []} = neutrino.options.packageJson;
files files
.filter((file) => { .filter((file) => {

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -21,9 +21,6 @@ module.exports = () => (neutrino) => {
template: `${neutrino.options.root}/client/index.ejs`, template: `${neutrino.options.root}/client/index.ejs`,
}, },
style: { style: {
extract: {
enabled: false,
},
test: /\.(css|sass|scss)$/, test: /\.(css|sass|scss)$/,
modulesTest: /\.module\.(css|sass|scss)$/, modulesTest: /\.module\.(css|sass|scss)$/,
loaders: [ loaders: [

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,5 +1,6 @@
**/*.js **/*.js
**/*.map **/*.map
/assets
!/.* !/.*
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js