more testing and cleanup webpack config

This commit is contained in:
knoxfighter 2018-08-24 18:52:05 +02:00
parent 47b9bf64b8
commit 179e1c24b5
2 changed files with 11 additions and 24 deletions

View File

@ -5,7 +5,7 @@
"main": "ui/index.js",
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js --mode=development",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",

View File

@ -14,7 +14,7 @@ module.exports = {
alias: {
Utilities: path.resolve(__dirname, 'ui/js/')
},
extensions: ['.wasm', '.mjs', '.js', '.json', '.jsx']
extensions: ['.js', '.json', '.jsx']
},
module: {
rules: [
@ -39,24 +39,18 @@ module.exports = {
{
loader: "file-loader",
options: {
name: path => {
console.log("es ist ein BILD!");
console.log(path);
if(!/node_modules|bower_components/.test(path)) {
name: loader_path => {
if(!/node_modules|bower_components/.test(loader_path)) {
return "app/images/[name].[ext]?[hash]";
}
return (
"app/images/vendor/" +
path.replace(/\\/g, "/")
.replace(
/((.*(node_modules|bower_components))|images|image|img|assets)\//g,
''
) +
loader_path.replace(/\\/g, "/")
.replace(/((.*(node_modules))|images|image|img|assets)\//g, '') +
'?[hash]'
);
},
publicPath: 'app/'
}
}
]
@ -67,26 +61,19 @@ module.exports = {
{
loader: "file-loader",
options: {
name: path => {
console.log("testausgabe");
console.log(path);
if (!/node_modules|bower_components/.test(path)) {
name: loader_path => {
if (!/node_modules|bower_components/.test(loader_path)) {
return 'app/fonts/[name].[ext]?[hash]';
}
return (
'app/fonts' +
'/vendor/' +
path
'app/fonts/vendor/' +
loader_path
.replace(/\\/g, '/')
.replace(
/((.*(node_modules|bower_components))|fonts|font|assets)\//g,
''
) +
.replace(/((.*(node_modules))|fonts|font|assets)\//g, '') +
'?[hash]'
);
},
publicPath: 'app/'
}
}
]