blob: 55c618a3fcc29f17b1d4b830805d7455f7f39e6c [file] [log] [blame]
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {importMetaAssets} from '@web/rollup-plugin-import-meta-assets';
import {optimize} from 'svgo';
export default {
treeshake: false,
output: [{
format: 'esm',
assetFileNames: '[name][extname]',
}],
plugins:
[
importMetaAssets({
async transform(assetBuffer, assetPath) {
if (assetPath.endsWith('.svg')) {
const {data} = await optimize(assetBuffer.toString());
return data;
}
return null;
}
}),
],
};