Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2021-10-01 00:06:50 +0300
committerdartcafe <github@dartcafe.de>2021-10-01 00:06:50 +0300
commit210eb3ecef03f66b5b4cb295b63ab6b82dba4843 (patch)
tree5e025fa68a768cdcfebf8a0b9e3204aa20b95048 /webpack.config.js
parent555f3928008363a9cd3d4694e68fdd41854c6969 (diff)
removed cross-env updated webpack config
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js84
1 files changed, 84 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 00000000..63708f75
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,84 @@
+const path = require('path')
+const { VueLoaderPlugin } = require('vue-loader')
+const { CleanWebpackPlugin } = require('clean-webpack-plugin')
+const ESLintPlugin = require('eslint-webpack-plugin')
+const webpack = require('webpack')
+
+module.exports = {
+ entry: {
+ polls: path.join(__dirname, 'src/js/', 'main.js'),
+ userSettings: path.join(__dirname, 'src/js/', 'userSettings.js'),
+ adminSettings: path.join(__dirname, 'src/js/', 'adminSettings.js'),
+ },
+ output: {
+ path: path.resolve(__dirname, './js'),
+ publicPath: '/js/',
+ filename: '[name].js',
+ chunkFilename: 'polls.[name].[contenthash].js',
+ chunkLoadingGlobal: 'webpackJsonpOCAPolls',
+ },
+ module: {
+ rules: [
+ {
+ test: /\.vue$/,
+ loader: 'vue-loader',
+ options: {
+ compilerOptions: {
+ whitespace: 'condense',
+ },
+ },
+ },
+ {
+ test: /\.js$/,
+ loader: 'babel-loader',
+ exclude: /node_modules/,
+ },
+ {
+ test: /\.css$/,
+ use: [
+ 'vue-style-loader',
+ {
+ loader: 'css-loader',
+ options: { esModule: false },
+ },
+ ],
+ },
+ {
+ test: /\.scss$/,
+ use: [
+ 'vue-style-loader',
+ {
+ loader: 'css-loader',
+ options: { esModule: false },
+ },
+ 'sass-loader',
+ ],
+ },
+ {
+ test: /\.(png|jpg|gif|svg)$/,
+ loader: 'url-loader',
+ options: {
+ name: '[name].[ext]?[hash]',
+ },
+ },
+ ],
+ },
+ plugins: [
+ new VueLoaderPlugin(),
+ new CleanWebpackPlugin(),
+ new webpack.DefinePlugin({
+ appName: JSON.stringify('polls'),
+ }),
+ new ESLintPlugin({
+ quiet: true,
+ extensions: ['js', 'vue'],
+ }),
+ ],
+ resolve: {
+ alias: {
+ vue$: 'vue/dist/vue.esm.js',
+ src: path.resolve(__dirname, 'src/js'),
+ },
+ extensions: ['*', '.js', '.vue', '.json'],
+ },
+}