mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add webpack-dev-server
This commit is contained in:
parent
e7610b0e4a
commit
716ac36031
4 changed files with 45 additions and 18 deletions
13
package.json
13
package.json
|
@ -10,8 +10,10 @@
|
||||||
"eslint": "^5.16.0",
|
"eslint": "^5.16.0",
|
||||||
"file-loader": "^3.0.1",
|
"file-loader": "^3.0.1",
|
||||||
"style-loader": "^0.23.1",
|
"style-loader": "^0.23.1",
|
||||||
"webpack": "^4.29.5",
|
"webpack": "^4.41.0",
|
||||||
"webpack-cli": "^3.2.3"
|
"webpack-cli": "^3.3.9",
|
||||||
|
"webpack-dev-server": "^3.8.1",
|
||||||
|
"webpack-merge": "^4.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jstree": "^3.3.7",
|
"jstree": "^3.3.7",
|
||||||
|
@ -23,9 +25,8 @@
|
||||||
"libjass": "^0.11.0"
|
"libjass": "^0.11.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack --mode development",
|
"start": "webpack-dev-server --config webpack.dev.js --open",
|
||||||
"build": "webpack --mode production",
|
"build": "webpack --config webpack.prod.js",
|
||||||
"lint": "eslint \"src\"",
|
"lint": "eslint \"src\""
|
||||||
"prepare": "webpack --mode production"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const CopyPlugin = require('copy-webpack-plugin');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
context: path.resolve(__dirname, 'src'),
|
context: path.resolve(__dirname, 'src'),
|
||||||
entry: './bundle.js',
|
entry: './bundle.js',
|
||||||
output: {
|
|
||||||
filename: 'bundle.js',
|
|
||||||
path: path.resolve(__dirname, 'dist'),
|
|
||||||
libraryTarget: 'amd-require'
|
|
||||||
},
|
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: [
|
modules: [
|
||||||
path.resolve(__dirname, 'node_modules')
|
path.resolve(__dirname, 'node_modules')
|
||||||
|
@ -26,10 +20,4 @@ module.exports = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
|
||||||
new CopyPlugin([{
|
|
||||||
from: '**/*',
|
|
||||||
to: '.'
|
|
||||||
}])
|
|
||||||
]
|
|
||||||
};
|
};
|
19
webpack.dev.js
Normal file
19
webpack.dev.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
const path = require("path");
|
||||||
|
const common = require("./webpack.common");
|
||||||
|
const merge = require("webpack-merge");
|
||||||
|
const CopyPlugin = require('copy-webpack-plugin');
|
||||||
|
|
||||||
|
module.exports = merge(common, {
|
||||||
|
mode: "development",
|
||||||
|
output: {
|
||||||
|
filename: 'bundle.js',
|
||||||
|
path: path.resolve(__dirname, 'dist'),
|
||||||
|
libraryTarget: 'amd-require'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new CopyPlugin([{
|
||||||
|
from: '**/*',
|
||||||
|
to: '.'
|
||||||
|
}])
|
||||||
|
]
|
||||||
|
});
|
19
webpack.prod.js
Normal file
19
webpack.prod.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
const path = require("path");
|
||||||
|
const common = require("./webpack.common");
|
||||||
|
const merge = require("webpack-merge");
|
||||||
|
const CopyPlugin = require('copy-webpack-plugin');
|
||||||
|
|
||||||
|
module.exports = merge(common, {
|
||||||
|
mode: "production",
|
||||||
|
output: {
|
||||||
|
filename: 'bundle.js',
|
||||||
|
path: path.resolve(__dirname, 'dist'),
|
||||||
|
libraryTarget: 'amd-require'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new CopyPlugin([{
|
||||||
|
from: '**/*',
|
||||||
|
to: '.'
|
||||||
|
}])
|
||||||
|
]
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue