Commit 02210e84 authored by Fabien Amarger's avatar Fabien Amarger
Browse files

feat: [webpack] Add the webpack config to handle the marker png and leaflet css

parent 2210cdc5fa14
Pipeline #13918 failed with stages
in 3 minutes and 33 seconds
const path = require('path'); const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const isProd = process.env.NODE_ENV === 'production'; const isProd = process.env.NODE_ENV === 'production';
module.exports = { module.exports = {
...@@ -26,10 +27,10 @@ module.exports = { ...@@ -26,10 +27,10 @@ module.exports = {
options: { appendTsSuffixTo: [/\.vue$/] }, options: { appendTsSuffixTo: [/\.vue$/] },
}, },
{ {
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/, test: /\.(ttf|eot|svg|woff(2)?|png|jpe?g|gif)(\?[a-z0-9=&.]+)?$/,
loader: 'file-loader', loader: 'file-loader',
}, },
{ test: /\.css$/, loader: 'css-loader' }, { test: /\.css$/, loader: ['style-loader', 'css-loader'] },
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' }, { enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
], ],
}, },
......
...@@ -17,6 +17,7 @@ module.exports = merge(common, { ...@@ -17,6 +17,7 @@ module.exports = merge(common, {
transform: (content) => content.toString().split('{DOMAIN}').join(DOMAIN), // replace all transform: (content) => content.toString().split('{DOMAIN}').join(DOMAIN), // replace all
}, },
{ from: 'node_modules/@logilab/libview/build/index.html', to: 'index.html' }, { from: 'node_modules/@logilab/libview/build/index.html', to: 'index.html' },
{ from: 'node_modules/leaflet/dist/images/*', to: 'images/', flatten: true },
], ],
}), }),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
......
...@@ -17,6 +17,7 @@ module.exports = merge(common, { ...@@ -17,6 +17,7 @@ module.exports = merge(common, {
transform: (content) => content.toString().split('{DOMAIN}').join(DOMAIN), // replace all transform: (content) => content.toString().split('{DOMAIN}').join(DOMAIN), // replace all
}, },
{ from: 'node_modules/@logilab/libview/build/index.html', to: 'index.html' }, { from: 'node_modules/@logilab/libview/build/index.html', to: 'index.html' },
{ from: 'node_modules/leaflet/dist/images/*', to: 'images/', flatten: true },
], ],
}), }),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
......
Markdown is supported
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