2018-03-27 15:33:44 +00:00
|
|
|
let path = require('path');
|
2021-03-10 12:20:12 +00:00
|
|
|
const webpack = require('webpack');
|
2022-04-01 19:35:01 +00:00
|
|
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
|
|
|
const { VueLoaderPlugin } = require('vue-loader');
|
2021-04-28 14:25:15 +00:00
|
|
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
2017-12-04 15:37:16 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2018-05-17 18:45:01 +00:00
|
|
|
entry: {
|
2021-10-05 21:00:59 +00:00
|
|
|
tainacan_pages_common_scripts: './src/views/tainacan-pages-common-scripts.js',
|
|
|
|
tainacan_blocks_common_scripts: './src/views/gutenberg-blocks/tainacan-blocks-common-scripts.js',
|
2021-07-22 20:55:37 +00:00
|
|
|
tainacan_blocks_category_icon: './src/views/gutenberg-blocks/js/tainacan-blocks-category-icon.js',
|
2019-07-24 20:02:25 +00:00
|
|
|
|
2021-10-05 21:00:59 +00:00
|
|
|
block_terms_list: './src/views/gutenberg-blocks/blocks/terms-list/index.js',
|
|
|
|
block_items_list: './src/views/gutenberg-blocks/blocks/items-list/index.js',
|
|
|
|
block_dynamic_items_list: './src/views/gutenberg-blocks/blocks/dynamic-items-list/index.js',
|
|
|
|
block_carousel_items_list: './src/views/gutenberg-blocks/blocks/carousel-items-list/index.js',
|
|
|
|
block_search_bar: './src/views/gutenberg-blocks/blocks/search-bar/index.js',
|
|
|
|
block_collections_list: './src/views/gutenberg-blocks/blocks/collections-list/index.js',
|
|
|
|
block_carousel_collections_list: './src/views/gutenberg-blocks/blocks/carousel-collections-list/index.js',
|
2021-10-13 18:25:30 +00:00
|
|
|
block_related_items_list: './src/views/gutenberg-blocks/blocks/related-items-list/index.js',
|
2021-10-05 21:00:59 +00:00
|
|
|
block_facets_list: './src/views/gutenberg-blocks/blocks/facets-list/index.js',
|
|
|
|
block_item_submission_form: './src/views/gutenberg-blocks/blocks/item-submission-form/index.js',
|
|
|
|
block_faceted_search: './src/views/gutenberg-blocks/blocks/faceted-search/index.js',
|
2022-02-22 12:14:06 +00:00
|
|
|
block_carousel_terms_list: './src/views/gutenberg-blocks/blocks/carousel-terms-list/index.js',
|
|
|
|
block_item_gallery: './src/views/gutenberg-blocks/blocks/item-gallery/index.js'
|
2018-01-23 14:42:01 +00:00
|
|
|
},
|
2017-12-04 15:37:16 +00:00
|
|
|
output: {
|
2020-01-14 16:26:15 +00:00
|
|
|
path: path.resolve(__dirname, './src/assets/js/'),
|
2021-08-12 12:23:23 +00:00
|
|
|
publicPath: './wp-content/plugins/tainacan/assets/js/',
|
2020-01-13 16:47:07 +00:00
|
|
|
filename: '[name].js'
|
2017-12-04 15:37:16 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
2018-03-23 13:20:37 +00:00
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
|
|
|
exclude: /node_modules/,
|
2022-04-01 19:35:01 +00:00
|
|
|
loader: 'vue-loader'
|
2017-12-04 15:37:16 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2020-01-14 17:08:31 +00:00
|
|
|
exclude: /node_modules/,
|
2018-01-26 14:17:30 +00:00
|
|
|
loader: 'babel-loader',
|
2017-12-04 15:37:16 +00:00
|
|
|
},
|
|
|
|
{
|
2018-11-13 14:05:48 +00:00
|
|
|
test: /\.(png|jpg|jpeg|gif|eot|ttf|otf|woff|woff2|svg|svgz)(\?.+)?$/,
|
2018-01-26 14:17:30 +00:00
|
|
|
loader: 'file-loader'
|
2018-01-23 14:42:01 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2018-05-18 15:44:07 +00:00
|
|
|
use: [
|
|
|
|
'vue-style-loader',
|
|
|
|
'css-loader',
|
|
|
|
'postcss-loader',
|
|
|
|
],
|
2018-02-22 19:10:10 +00:00
|
|
|
},
|
|
|
|
{
|
2018-05-18 15:44:07 +00:00
|
|
|
test: /\.s[ac]ss$/,
|
2020-01-14 17:08:31 +00:00
|
|
|
exclude: /node_modules/,
|
2018-05-18 15:44:07 +00:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'style-loader',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: 'css-loader'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: 'sass-loader',
|
|
|
|
options: {
|
2022-04-01 19:35:01 +00:00
|
|
|
sassOptions: {
|
|
|
|
includePaths: [path.resolve(__dirname, './src/views/admin/scss/_variables.scss')]
|
|
|
|
}
|
2018-05-18 15:44:07 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
],
|
2017-12-04 15:37:16 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2022-04-01 19:35:01 +00:00
|
|
|
resolve: {
|
|
|
|
fallback: {
|
|
|
|
fs: false,
|
|
|
|
net: false,
|
|
|
|
tls: false
|
|
|
|
}
|
2018-03-23 18:44:00 +00:00
|
|
|
},
|
2018-03-27 15:33:44 +00:00
|
|
|
performance: {
|
|
|
|
hints: false
|
2021-03-10 12:20:12 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
2022-04-04 20:37:43 +00:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'TAINACAN_ENV': JSON.stringify(process.env.NODE_ENV)
|
|
|
|
}),
|
2022-04-01 19:35:01 +00:00
|
|
|
new VueLoaderPlugin({
|
|
|
|
prettify: false
|
|
|
|
}),
|
2021-03-10 12:20:12 +00:00
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
'PhotoSwipe': 'PhotoSwipe'
|
2021-04-28 14:25:15 +00:00
|
|
|
}),
|
|
|
|
new MomentLocalesPlugin({
|
2021-11-23 20:21:21 +00:00
|
|
|
localesToKeep: ['en', 'en-ca', 'en-nz', 'en-gb', 'es-au', 'el', 'es-in', 'pt-br', 'pt', 'es', 'es-us', 'es-mx', 'es-do', 'fr', 'fr-ch', 'fr-ca', 'sv'],
|
2022-04-01 19:35:01 +00:00
|
|
|
}),
|
|
|
|
new ESLintPlugin({
|
|
|
|
extensions: ['vue'],
|
|
|
|
exclude: ['/node_modules/']
|
2021-08-12 12:23:23 +00:00
|
|
|
})
|
2022-04-01 19:35:01 +00:00
|
|
|
],
|
|
|
|
stats: {
|
|
|
|
errorDetails: true,
|
|
|
|
children: true
|
|
|
|
}
|
2020-11-19 19:22:43 +00:00
|
|
|
};
|