fix(Desktop): Allowing loading images using 'local:' protocol
@@ -8,75 +8,75 @@ const rules = require('./webpack.rules')
rules.push({
test: /\.css$/,
- use: [{ loader: 'style-loader' }, { loader: 'css-loader' }]
+ use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
})
module.exports = {
module: {
- rules
+ rules,
},
plugins: [
...plugins,
new webpack.DefinePlugin({
- 'process.type': '"renderer"'
+ 'process.type': '"renderer"',
}),
new HtmlInsertTagWebpackPlugin([
{
tagName: 'base',
inject: {
tagName: 'head',
- location: 'after'
+ location: 'after',
},
attributes: {
- href: 'stencila://rse'
- }
- }
+ href: 'stencila://rse',
+ },
+ },
]),
new CspHtmlWebpackPlugin(
{
'base-uri': "'self' stencila://rse",
'default-src': 'stencila://rse',
'script-src': ["'self'"],
- 'img-src': ["'self'", 'data:'],
+ 'img-src': ["'self'", 'data:', 'local:'],
'style-src': [
"'self'",
"'unsafe-inline'",
'https://unpkg.com/',
- 'https://fonts.googleapis.com/'
+ 'https://fonts.googleapis.com/',
],
'connect-src': "'self'",
'font-src': [
"'self'",
'https://fonts.gstatic.com/',
- 'https://unpkg.com/'
- ]
+ 'https://unpkg.com/',
+ ],
},
{
hashEnabled: {
'script-src': true,
- 'style-src': true
+ 'style-src': true,
},
nonceEnabled: {
'script-src': true,
- 'style-src': false
- }
+ 'style-src': false,
+ },
}
),
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, 'www', 'build'),
- to: 'build'
+ to: 'build',
},
{
from: path.resolve(__dirname, 'www', 'assets'),
- to: 'assets'
- }
- ]
- })
+ to: 'assets',
+ },
+ ],
+ }),
],
resolve: {
mainFields: ['browser', 'module', 'main'],
- extensions: ['.js', '.mjs', '.ts', '.css']
- }
+ extensions: ['.js', '.mjs', '.ts', '.css'],
+ },
}
