Plant a typescript seed into webpack config

This commit is contained in:
Tamius Han 2020-12-02 22:39:57 +01:00
parent a91ed7368f
commit 8325e44a0e

View File

@ -23,10 +23,18 @@ const config = {
filename: '[name].js', filename: '[name].js',
}, },
resolve: { resolve: {
extensions: ['.js', '.vue'], // maybe we'll move to TS some day, but today is not the day
extensions: [
// '.ts', '.tsx',
'.js', '.vue'
],
}, },
module: { module: {
rules: [ rules: [
// {
// test: /\.tsx?$/,
// loader: 'ts-loader',
// },
{ {
test: /\.vue$/, test: /\.vue$/,
loaders: 'vue-loader', loaders: 'vue-loader',
@ -77,6 +85,13 @@ const config = {
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ from: 'res', to: 'res', ignore: ['css', 'css/**']}, { from: 'res', to: 'res', ignore: ['css', 'css/**']},
{ from: 'ext', to: 'ext', ignore: ['conf/*', 'lib/**']}, { from: 'ext', to: 'ext', ignore: ['conf/*', 'lib/**']},
// This is a hack to get bootstrap icons svg file in /res/icons
{ from: '../node_modules/bootstrap-icons/bootstrap-icons.svg', to: 'res/icons/bootstrap-icons.svg'},
// This is extension icon, as used on extension lists and/or extension's action button
// This folder does not contain any GUI icons — these are in /res/icons.
// (TODO: check if this copy is even necessary — /icons has same content as /res/icons)
{ from: 'icons', to: 'icons', ignore: ['icon.xcf'] }, { from: 'icons', to: 'icons', ignore: ['icon.xcf'] },
{ from: 'popup/popup.html', to: 'popup/popup.html', transform: transformHtml }, { from: 'popup/popup.html', to: 'popup/popup.html', transform: transformHtml },
{ from: 'options/options.html', to: 'options/options.html', transform: transformHtml }, { from: 'options/options.html', to: 'options/options.html', transform: transformHtml },