Gitlab Community Edition Instance

Commit 9b2d339f authored by Gregor Thiem's avatar Gregor Thiem
Browse files

test 1.9 RC

parent 35b0fbe9
......@@ -14,19 +14,9 @@
<base href="<%- serverURL %>/">
<title><%= title %></title>
<%- include('includes/favicon.ejs') %>
<% if(useCDN) { %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fork-awesome/1.1.3/css/fork-awesome.min.css" integrity="sha256-ZhApazu+kejqTYhMF+1DzNKjIzP7KXu6AzyXcC1gMus=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0/css/reveal.min.css" integrity="sha256-9+Wg2bcNeiOMGXOUNqBdceY2lAH/eCiTDcdzHhHIl48=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" />
<%- include('build/slide-header') %>
<%- include('shared/polyfill') %>
<% } else { %>
<link rel="stylesheet" href="<%- serverURL %>/build/reveal.js/css/reveal.css">
<link rel="stylesheet" href='<%- serverURL %>/build/emojify.js/dist/css/basic/emojify.min.css'>
<%- include('build/slide-pack-header') %>
<% } %>
<!-- For reveal.js theme -->
<% if(typeof theme !== 'undefined' && theme) { %>
......@@ -87,30 +77,10 @@
</div>
<script src="<%= serverURL %>/js/mathjax-config-extra.js"></script>
<% if(useCDN) { %>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.9.2/js/reveal.js" integrity="sha512-VMwkG0MdbDSSM3wUzu6Ny450qkGMXTuBJdN1ssTZPTNWBkXxSYuvhW/o6eu7YQ2H1X2X1thKs6xdt8+obhX4Gg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.4.0/velocity.min.js" integrity="sha256-bhm0lgEt6ITaZCDzZpkr/VXVrLa5RP4u9v2AYsbzSUk=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js" integrity="sha256-jnOjDTXIPqall8M0MyTSt98JetJuZ7Yu+1Jm7hLTF7U=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.7.0/js-yaml.min.js" integrity="sha256-8PanqYAVOGlOct+i65R+HqibK3KPsXINnrSfxN+Y/J0=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js" integrity="sha256-DViIOMYdwlM/axqoGDPeUyf0urLoHMN4QACBKyB58Uw=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-h37FgDAy5VfttFY2Jw5jcIQpvTvxY6QxTTwoDwlhg/E=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/config/Safe.js" integrity="sha256-y9JZetUlOMMh4hOP7XzJyCxx5xFrN4qSiBRIHfns3Dk=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment-with-locales.min.js" integrity="sha256-vvT7Ok9u6GbfnBPXnbM6FVDEO8E1kTdgHOFZOAXrktA=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.8.2/mermaid.min.js" integrity="sha256-KqisLh8jVMBRjpNkOhH5W9VWs+F6x6vQksLqxs7+x9A=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/js/emojify.min.js" integrity="sha256-VAB5tAlKBvgaxw8oJ1crWMVbdmBVl4mP/2M8MNRl+4E=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.6/handlebars.min.js" integrity="sha256-1O3BtOwnPyyRzOszK6P+gqaRoXHV6JXj8HkjZmPYhCI=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js" integrity="sha256-/BfiIkHlHoVihZdc6TFuj7MmJ0TWcWsMXkeDFwhi0zw=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gist-embed/2.6.0/gist-embed.min.js" integrity="sha256-KyF2D6xPIJUW5sUDSs93vWyZm+1RzIpKCexxElmxl8g=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.7.0/viz.js" integrity="sha256-8t+rndrF+TU4JtelmOH1lDHTMe2ovhO2UbzDArp5lY8=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/abcjs/3.1.1/abcjs_basic-min.js" integrity="sha256-Sq1r2XXWXQoShQKsS0Wrf5r7fRkErd9Fat9vHYeU68s=" crossorigin="anonymous"></script>
<%- include('build/slide-scripts') %>
<% } else { %>
<script src="<%- serverURL %>/build/MathJax/MathJax.js" defer></script>
<script src="<%- serverURL %>/build/MathJax/config/TeX-AMS-MML_HTMLorMML.js" defer></script>
<script src="<%- serverURL %>/build/MathJax/config/Safe.js" defer></script>
<%- include('build/slide-pack-scripts') %>
<% } %>
</body>
</html>
......
......@@ -27,7 +27,6 @@ describe('Content security policies', function () {
upgradeInsecureRequests: 'auto',
reportURI: undefined
},
useCDN: true,
dropbox: {
appKey: undefined
}
......@@ -44,28 +43,22 @@ describe('Content security policies', function () {
csp = mock.reRequire('../lib/csp')
})
// beginnging Tests
it('Disable CDN', function () {
it('Disable Google Analytics', function () {
const testconfig = defaultConfig
testconfig.useCDN = false
testconfig.csp.addGoogleAnalytics = false
mock('../lib/config', testconfig)
csp = mock.reRequire('../lib/csp')
assert(!csp.computeDirectives().scriptSrc.includes('https://cdnjs.cloudflare.com'))
assert(!csp.computeDirectives().scriptSrc.includes('https://cdn.mathjax.org'))
assert(!csp.computeDirectives().styleSrc.includes('https://cdnjs.cloudflare.com'))
assert(!csp.computeDirectives().styleSrc.includes('https://fonts.googleapis.com'))
assert(!csp.computeDirectives().fontSrc.includes('https://cdnjs.cloudflare.com'))
assert(!csp.computeDirectives().fontSrc.includes('https://fonts.gstatic.com'))
assert(!csp.computeDirectives().scriptSrc.includes('https://www.google-analytics.com'))
})
it('Disable Google Analytics', function () {
it('Enable Google Analytics', function () {
const testconfig = defaultConfig
testconfig.csp.addGoogleAnalytics = false
testconfig.csp.addGoogleAnalytics = true
mock('../lib/config', testconfig)
csp = mock.reRequire('../lib/csp')
assert(!csp.computeDirectives().scriptSrc.includes('https://www.google-analytics.com'))
assert(csp.computeDirectives().scriptSrc.includes('https://www.google-analytics.com'))
})
it('Disable Disqus', function () {
......@@ -81,6 +74,19 @@ describe('Content security policies', function () {
assert(!csp.computeDirectives().fontSrc.includes('https://*.disquscdn.com'))
})
it('Enable Disqus', function () {
const testconfig = defaultConfig
testconfig.csp.addDisqus = true
mock('../lib/config', testconfig)
csp = mock.reRequire('../lib/csp')
assert(csp.computeDirectives().scriptSrc.includes('https://disqus.com'))
assert(csp.computeDirectives().scriptSrc.includes('https://*.disqus.com'))
assert(csp.computeDirectives().scriptSrc.includes('https://*.disquscdn.com'))
assert(csp.computeDirectives().styleSrc.includes('https://*.disquscdn.com'))
assert(csp.computeDirectives().fontSrc.includes('https://*.disquscdn.com'))
})
it('Include dropbox if configured', function () {
const testconfig = defaultConfig
testconfig.dropbox.appKey = 'hedgedoc'
......@@ -122,7 +128,7 @@ describe('Content security policies', function () {
const variations = ['default', 'script', 'img', 'style', 'font', 'object', 'media', 'child', 'connect']
for (let i = 0; i < variations.length; i++) {
assert.strictEqual(csp.computeDirectives()[variations[i] + 'Src'].toString(), ['https://' + variations[i] + '.example.com'].concat(unextendedCSP[variations[i] + 'Src']).toString())
assert.strictEqual(csp.computeDirectives()[variations[i] + 'Src'].toString(), ['https://' + variations[i] + '.example.com'].concat(unextendedCSP[variations[i] + 'Src']).filter(x => x != null).toString())
}
})
......
......@@ -20,14 +20,7 @@ module.exports = {
jQuery: 'jquery',
'window.jQuery': 'jquery',
'moment': 'moment',
'Handlebars': 'handlebars'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
chunks: ['font', 'index-styles', 'index'],
filename: path.join(__dirname, 'public/views/build/index-header.ejs'),
inject: false,
chunksSortMode: 'manual'
CodeMirror: 'codemirror/lib/codemirror.js'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
......@@ -36,12 +29,6 @@ module.exports = {
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['index'],
filename: path.join(__dirname, 'public/views/build/index-scripts.ejs'),
inject: false
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['common', 'index-pack'],
......@@ -49,13 +36,6 @@ module.exports = {
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
chunks: ['font', 'cover'],
filename: path.join(__dirname, 'public/views/build/cover-header.ejs'),
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
chunks: ['font-pack', 'cover-styles-pack', 'cover'],
......@@ -63,12 +43,6 @@ module.exports = {
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['cover'],
filename: path.join(__dirname, 'public/views/build/cover-scripts.ejs'),
inject: false
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['common', 'cover-pack'],
......@@ -76,13 +50,6 @@ module.exports = {
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
chunks: ['font', 'pretty-styles', 'pretty'],
filename: path.join(__dirname, 'public/views/build/pretty-header.ejs'),
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
chunks: ['font-pack', 'pretty-styles-pack', 'pretty-styles', 'pretty'],
......@@ -90,12 +57,6 @@ module.exports = {
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['pretty'],
filename: path.join(__dirname, 'public/views/build/pretty-scripts.ejs'),
inject: false
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['common', 'pretty-pack'],
......@@ -103,13 +64,6 @@ module.exports = {
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
chunks: ['font', 'slide-styles', 'slide'],
filename: path.join(__dirname, 'public/views/build/slide-header.ejs'),
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/header.ejs',
chunks: ['font-pack', 'slide-styles-pack', 'slide-styles', 'slide'],
......@@ -117,12 +71,6 @@ module.exports = {
inject: false,
chunksSortMode: 'manual'
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['slide'],
filename: path.join(__dirname, 'public/views/build/slide-scripts.ejs'),
inject: false
}),
new HtmlWebpackPlugin({
template: 'public/views/includes/scripts.ejs',
chunks: ['slide-pack'],
......@@ -184,7 +132,6 @@ module.exports = {
],
entry: {
font: path.join(__dirname, 'public/css/google-font.css'),
'font-pack': path.join(__dirname, 'public/css/font.css'),
common: [
'expose-loader?exposes[]=$&exposes[]=jQuery!jquery',
......@@ -212,22 +159,13 @@ module.exports = {
],
index: [
'babel-polyfill',
'script-loader!jquery-ui-resizable',
'script-loader!Idle.Js',
'expose-loader?exposes=LZString!lz-string',
'script-loader!codemirror',
'script-loader!inlineAttachment',
'script-loader!jqueryTextcomplete',
'script-loader!codemirrorSpellChecker',
'script-loader!codemirrorInlineAttachment',
'script-loader!ot',
'flowchart.js',
'js-sequence-diagrams',
'expose-loader?exposes=RevealMarkdown!reveal-markdown',
path.join(__dirname, 'public/js/index.js')
],
'index-styles': [
path.join(__dirname, 'public/vendor/jquery-ui/jquery-ui.min.css'),
path.join(__dirname, 'public/vendor/codemirror-spell-checker/spell-checker.min.css'),
path.join(__dirname, 'node_modules/codemirror/lib/codemirror.css'),
path.join(__dirname, 'node_modules/codemirror/addon/fold/foldgutter.css'),
......@@ -254,27 +192,13 @@ module.exports = {
],
'index-pack': [
'babel-polyfill',
'script-loader!jquery-ui-resizable',
'bootstrap-validator',
'expose-loader?exposes=jsyaml!js-yaml',
'script-loader!mermaid',
'expose-loader?exposes=moment!moment',
'script-loader!handlebars',
'expose-loader?exposes=hljs!highlight.js',
'expose-loader?exposes=emojify!emojify.js',
'script-loader!Idle.Js',
'script-loader!gist-embed',
'expose-loader?exposes=LZString!lz-string',
'script-loader!codemirror',
'script-loader!inlineAttachment',
'script-loader!jqueryTextcomplete',
'script-loader!codemirrorSpellChecker',
'script-loader!codemirrorInlineAttachment',
'script-loader!ot',
'flowchart.js',
'js-sequence-diagrams',
'expose-loader?exposes=Viz!viz.js',
'script-loader!abcjs',
'expose-loader?exposes=io!socket.io-client',
'expose-loader?exposes=RevealMarkdown!reveal-markdown',
path.join(__dirname, 'public/js/index.js')
......@@ -300,16 +224,10 @@ module.exports = {
'pretty-pack': [
'babel-polyfill',
'expose-loader?exposes=jsyaml!js-yaml',
'script-loader!mermaid',
'expose-loader?exposes=moment!moment',
'script-loader!handlebars',
'expose-loader?exposes=hljs!highlight.js',
'expose-loader?exposes=emojify!emojify.js',
'script-loader!gist-embed',
'flowchart.js',
'js-sequence-diagrams',
'expose-loader?exposes=Viz!viz.js',
'script-loader!abcjs',
'expose-loader?exposes=RevealMarkdown!reveal-markdown',
path.join(__dirname, 'public/js/pretty.js')
],
......@@ -338,16 +256,10 @@ module.exports = {
'imports-loader?imports=default|jquery|$!jquery-mousewheel',
'bootstrap-tooltip',
'expose-loader?exposes=jsyaml!js-yaml',
'script-loader!mermaid',
'expose-loader?exposes=moment!moment',
'script-loader!handlebars',
'expose-loader?exposes=hljs!highlight.js',
'expose-loader?exposes=emojify!emojify.js',
'script-loader!gist-embed',
'flowchart.js',
'js-sequence-diagrams',
'expose-loader?exposes=Viz!viz.js',
'script-loader!abcjs',
'expose-loader?exposes=Reveal!reveal.js',
'expose-loader?exposes=RevealMarkdown!reveal-markdown',
path.join(__dirname, 'public/js/slide.js')
......@@ -364,106 +276,122 @@ module.exports = {
modules: ['node_modules'],
extensions: ['.js'],
alias: {
codemirror: path.join(__dirname, 'node_modules/codemirror/codemirror.min.js'),
inlineAttachment: path.join(__dirname, 'public/vendor/inlineAttachment/inline-attachment.js'),
jqueryTextcomplete: path.join(__dirname, 'public/vendor/jquery-textcomplete/jquery.textcomplete.js'),
codemirrorSpellChecker: path.join(__dirname, 'public/vendor/codemirror-spell-checker/spell-checker.min.js'),
codemirrorInlineAttachment: path.join(__dirname, 'public/vendor/inlineAttachment/codemirror.inline-attachment.js'),
ot: path.join(__dirname, 'public/vendor/ot/ot.min.js'),
mermaid: path.join(__dirname, 'node_modules/mermaid/dist/mermaid.min.js'),
handlebars: path.join(__dirname, 'node_modules/handlebars/dist/handlebars.min.js'),
'jquery-ui-resizable': path.join(__dirname, 'public/vendor/jquery-ui/jquery-ui.min.js'),
'gist-embed': path.join(__dirname, 'node_modules/gist-embed/gist-embed.min.js'),
'bootstrap-tooltip': path.join(__dirname, 'public/vendor/bootstrap/tooltip.min.js'),
'reveal-markdown': path.join(__dirname, 'public/js/reveal-markdown.js'),
abcjs: path.join(__dirname, 'public/vendor/abcjs_basic_3.1.1-min.js'),
raphael: path.join(__dirname, 'node_modules/raphael/raphael.no-deps.js')
}
},
externals: {
'viz.js': 'Viz',
'socket.io-client': 'io',
'jquery': '$',
'moment': 'moment',
'handlebars': 'Handlebars',
'highlight.js': 'hljs',
'select2': 'select2'
},
module: {
rules: [{
test: /\.js$/,
use: [{ loader: 'babel-loader' }],
exclude: [/node_modules/, /public\/vendor/]
}, {
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
rules: [
{
test: require.resolve(path.join(__dirname, 'public/vendor/codemirror-spell-checker/spell-checker.min.js')),
use: {
loader: 'imports-loader',
options: {
publicPath: '',
imports: ['default codemirror CodeMirror']
}
},
'css-loader'
]
}, {
test: /\.less$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
}
},
{
test: require.resolve(path.join(__dirname, 'public/vendor/ot/ot.min.js')),
use: {
loader: 'exports-loader',
options: {
importLoaders: 1
type: 'commonjs',
exports: ['ot']
}
},
'less-loader'
]
}, {
test: require.resolve('js-sequence-diagrams'),
use: [{
loader: 'imports-loader',
options: {
imports: ['default lodash _', 'default raphael Raphael', 'default eve eve']
parser: {
amd: false
}
},
{
// Idle.js must be imported as CommonJS, as its AMD export is broken
test: require.resolve('Idle.Js'),
parser: {
amd: false
}
},
{
test: /\.js$/,
use: [{ loader: 'babel-loader' }],
exclude: [/node_modules/, /public\/vendor/]
}, {
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: '',
}
},
'css-loader'
]
}, {
test: /\.less$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
importLoaders: 1
}
},
'less-loader'
]
}, {
test: require.resolve('js-sequence-diagrams'),
use: [{
loader: 'imports-loader',
options: {
imports: ['default lodash _', 'default raphael Raphael', 'default eve eve']
}
}]
}, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
use: [{ loader: 'file-loader' }]
}, {
test: /\.html$/,
use: [{ loader: 'string-loader' }]
}, {
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { prefix: 'font/', limit: '5000' }
}]
}, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '5000', mimetype: 'application/octet-stream' }
}]
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '10000', mimetype: 'svg+xml' }
}]
}, {
test: /\.png(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '10000', mimetype: 'image/png' }
}]
}, {
test: /\.gif(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '10000', mimetype: 'image/gif' }
}]
}]
}, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
use: [{ loader: 'file-loader' }]
}, {
test: /\.html$/,
use: [{ loader: 'string-loader' }]
}, {
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { prefix: 'font/', limit: '5000' }
}]
}, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '5000', mimetype: 'application/octet-stream' }
}]
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '10000', mimetype: 'svg+xml' }
}]
}, {
test: /\.png(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '10000', mimetype: 'image/png' }
}]
}, {
test: /\.gif(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'url-loader',
options: { limit: '10000', mimetype: 'image/gif' }
}]
}]
},
node: {
fs: 'empty'
......
......@@ -6,9 +6,9 @@ module.exports = [
// merge common config
merge(common, {
mode: 'development',
devtool: 'eval-cheap-module-source-map'
devtool: 'cheap-module-source-map'
}),
merge(htmlexport, {
mode: 'development',
devtool: 'eval-cheap-module-source-map'
devtool: 'cheap-module-source-map'
})]
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
name: 'save-as-html',
......@@ -10,6 +11,14 @@ module.exports = {
rules: [{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader']
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'url-loader'
}
]
}]
},
output: {
......@@ -18,8 +27,13 @@ module.exports = {
filename: '[name].js'
},
plugins: [
new MiniCssExtractPlugin({
filename: 'html.min.css'
})
new HtmlWebpackPlugin({
// Load a custom template (uses lodash templating)
template: 'public/views/htmlexport.ejs',
filename: 'htmlexport.html',
inject: false,
cache: false
}),
new MiniCssExtractPlugin({ filename: 'htmlexport.css' })
]
}
......@@ -16,15 +16,23 @@ module.exports = [
optimization: {
minimizer: [
new ESBuildMinifyPlugin({
target: 'es2015'
target: 'es2015',
exclude: ['MathJax/extensions/a11y/mathmaps']
})
]
}
],
splitChunks: {
chunks: 'all'
}
},
devtool: 'source-map'
}),
merge(htmlexport, {
mode: 'production',
optimization: {
minimizer: [
new ESBuildMinifyPlugin({
target: 'es2015'
}),
new OptimizeCSSAssetsPlugin({})
]
}
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment