53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
const CspHtmlWebpackPlugin = require("csp-html-webpack-plugin");
|
|
|
|
module.exports = {
|
|
mode: "development",
|
|
entry: './src/index.js',
|
|
output: {
|
|
filename: 'steam.js',
|
|
path: __dirname + '/public'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.scss$/,
|
|
use: [
|
|
'style-loader',
|
|
'css-loader',
|
|
'sass-loader'
|
|
]
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new CspHtmlWebpackPlugin({
|
|
'default-src': "'self' 'unsafe-eval' 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' ws://localhost:8080",
|
|
'style-src': "'self' 'unsafe-eval' 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' ws://localhost:8080"
|
|
})
|
|
],
|
|
devServer: {
|
|
port: 9010,
|
|
hot: true,
|
|
static: {
|
|
directory: __dirname + '/public',
|
|
publicPath: '/'
|
|
},
|
|
historyApiFallback: false,
|
|
proxy: [
|
|
{
|
|
'/api': {
|
|
target: 'http://localhost:9010',
|
|
router: () => 'http://localhost:5000',
|
|
logLevel: 'debug' /*optional*/
|
|
}
|
|
|
|
// {
|
|
// '/api': {
|
|
// target: 'https://steamcommunity.com',
|
|
// changeOrigin: true,
|
|
// pathRewrite: { '^/api': '' }
|
|
// }
|
|
}]
|
|
},
|
|
|
|
} |