Commit ad8efeea authored by void's avatar void
Browse files

cambiar de vue-cli a webpack

parent 1f475df9
VUE_APP_API_URL=https://loom.lainventoria.com.ar
API_URL=https://loom.lainventoria.com.ar
......@@ -4,8 +4,8 @@
"private": true,
"license": "AGPL-3.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
"serve": "webpack-dev-server --env --dev",
"build": "webpack"
},
"dependencies": {
"core-js": "^2.6.5",
......@@ -14,12 +14,28 @@
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.6.0",
"@vue/cli-service": "^3.6.0",
"sass": "^1.18.0",
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@vue/babel-preset-app": "^3.8.0",
"babel-loader": "^8.0.6",
"brotli-webpack-plugin": "^1.1.0",
"buble": "^0.19.7",
"buble-loader": "^0.5.1",
"cache-loader": "^4.0.1",
"compression-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.0.3",
"css-loader": "^3.0.0",
"dotenv-webpack": "^1.7.0",
"file-loader": "^4.0.0",
"html-webpack-plugin": "^3.2.0",
"node-sass": "^4.12.0",
"sass-loader": "^7.1.0",
"vue-loader": "^15.7.0",
"vue-svg-loader": "^0.12.0",
"vue-template-compiler": "^2.6.10"
"vue-template-compiler": "^2.6.10",
"webpack": "^4.35.0",
"webpack-cli": "^3.3.5",
"webpack-dev-server": "^3.7.2"
},
"postcss": {
"plugins": {
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="manifest" href="<%= BASE_URL %>manifest.webmanifest">
<title>loom-frontend</title>
</head>
<body>
<noscript>
<strong>We're sorry but loom-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="favicon.ico" />
<link rel="manifest" href="manifest.webmanifest" />
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>Miniloom no anda sin javascript :(</strong>
<small>
Código:
<a
href="https://0xacab.org/partido-interdimensional-pirata/miniloom/web"
>
0xacab
</a>
</small>
</noscript>
<div id="app"></div>
</body>
</html>
module.exports = {
chainWebpack: config => {
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.oneOf('inline')
.resourceQuery(/inline/)
.use('vue-svg-loader')
.loader('vue-svg-loader')
.end()
.end()
.oneOf('external')
.use('file-loader')
.loader('file-loader')
.options({
name: 'assets/[name].[hash:8].[ext]',
})
},
}
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const BrotliPlugin = require('brotli-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
const DotenvPlugin = require('dotenv-webpack')
const webpack = require('webpack')
module.exports = function buildConfig(dev) {
if (dev) console.log('development mode')
return {
...((dev && {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
}) || { mode: 'production' }),
devServer: {
contentBase: './dist',
hot: true,
},
entry: './src/main.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.css$/,
use: [
...((dev && ['cache-loader']) || []),
'vue-style-loader',
'css-loader',
],
},
{
test: /\.scss$/,
use: [
...((dev && ['cache-loader']) || []),
'vue-style-loader',
'css-loader',
'sass-loader',
],
},
{
test: /\.sass$/,
use: [
...((dev && ['cache-loader']) || []),
'vue-style-loader',
'css-loader',
'sass-loader?indentedSyntax',
],
},
{
test: /\.svg$/,
oneOf: [
{
resourceQuery: /inline/,
loader: 'vue-svg-loader',
},
{
loader: 'file-loader',
query: {
name: 'assets/[name].[hash:8].[ext]',
},
},
],
},
{
test: /\.js$/,
use: [
...((dev && ['cache-loader']) || []),
{
loader: 'buble-loader',
options: {
objectAssign: 'Object.assign',
transforms: {
dangerousForOf: true,
asyncAwait: false,
},
},
},
],
include: path.join(__dirname, 'src'),
},
{
test: /\.vue$/,
use: [...((dev && ['cache-loader']) || []), 'vue-loader'],
},
{
test: /\.(png|jpg|gif|woff2)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]',
},
},
],
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src/'),
},
extensions: ['.wasm', '.mjs', '.js', '.json', '.vue'],
},
plugins: [
new VueLoaderPlugin(),
...((dev && [new webpack.HotModuleReplacementPlugin()]) || [
new CompressionWebpackPlugin(),
new BrotliPlugin(),
]),
new HtmlWebpackPlugin({
title: 'miniloom',
template: 'src/index.html',
}),
new CopyPlugin([{ from: 'public', to: '.' }]),
new DotenvPlugin(),
],
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
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