forked from Level51/silverstripe-cloudinary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started full client/fe refactor, using vue.js component instead of jQ…
…uery/entwine
- Loading branch information
Showing
27 changed files
with
25,638 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const settings = require('./client/config/webpack.resolve').forEsLint; | ||
|
||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
parser: 'babel-eslint' | ||
}, | ||
extends: [ | ||
'airbnb-base', | ||
'plugin:vue/strongly-recommended' | ||
], | ||
rules: { | ||
'no-new': 0, | ||
'comma-dangle': 0, | ||
radix: 0, | ||
'no-prototype-builtins': 0, | ||
'no-restricted-globals': 0, | ||
'no-underscore-dangle': 0, | ||
'vue/html-closing-bracket-newline': 0, | ||
'no-param-reassign': 0 | ||
}, | ||
globals: { | ||
cloudinary: false | ||
}, | ||
plugins: [ | ||
'vue' | ||
], | ||
settings | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const path = require('path'); | ||
const { VueLoaderPlugin } = require('vue-loader'); | ||
const { DefinePlugin } = require('webpack'); | ||
const MiniCSSExtractPlugin = require('mini-css-extract-plugin'); | ||
const resolve = require('./webpack.resolve').forWebpack; | ||
|
||
module.exports = env => ({ | ||
|
||
entry: { | ||
'level51-cloudinary-upload-field': ['@babel/polyfill/noConflict', 'src/cloudinaryUploadField.js'] | ||
}, | ||
|
||
output: { | ||
path: path.resolve(__dirname, '../dist'), | ||
filename: '[name].js', | ||
publicPath: '' // TODO check | ||
}, | ||
|
||
mode: 'development', | ||
|
||
devtool: 'source-map', | ||
|
||
resolve, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: file => ( | ||
/node_modules/.test(file) | ||
&& !/\.vue\.js/.test(file) | ||
), | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
plugins: [ | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-syntax-dynamic-import' | ||
], | ||
presets: [['@babel/preset-env', { modules: false }, '@babel/preset-stage-3']] | ||
} | ||
} | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
{ | ||
loader: 'vue-style-loader' | ||
}, | ||
{ | ||
loader: MiniCSSExtractPlugin.loader | ||
}, | ||
{ | ||
loader: 'css-loader' | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.less$/, | ||
use: [ | ||
{ | ||
loader: 'vue-style-loader' | ||
}, | ||
{ | ||
loader: MiniCSSExtractPlugin.loader | ||
}, | ||
{ | ||
loader: 'css-loader' | ||
}, | ||
{ | ||
loader: 'less-loader' | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.(png|jpg|gif|svg)$/, | ||
loader: 'file-loader', | ||
options: { | ||
name: '[name].[ext]?[hash]' | ||
} | ||
}, | ||
{ | ||
test: /\.(eot|svg|ttf|woff|woff2)$/, | ||
loader: 'file-loader', | ||
options: { | ||
name: '[name].[ext]' | ||
} | ||
} | ||
] | ||
}, | ||
|
||
plugins: [ | ||
new DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: JSON.stringify(env.NODE_ENV) | ||
} | ||
}), | ||
|
||
new VueLoaderPlugin(), | ||
|
||
new MiniCSSExtractPlugin({ | ||
filename: '[name].css' | ||
}) | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const path = require('path'); | ||
const { VueLoaderPlugin } = require('vue-loader'); | ||
const { DefinePlugin } = require('webpack'); | ||
const MiniCSSExtractPlugin = require('mini-css-extract-plugin'); | ||
const CompressionPlugin = require('compression-webpack-plugin'); | ||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | ||
|
||
const resolve = require('./webpack.resolve').forWebpack; | ||
|
||
module.exports = env => ({ | ||
|
||
entry: { | ||
'level51-cloudinary-upload-field': ['@babel/polyfill/noConflict', 'src/cloudinaryUploadField.js'] | ||
}, | ||
|
||
output: { | ||
path: path.resolve(__dirname, '../dist'), | ||
filename: '[name].js', | ||
publicPath: '' // TODO check | ||
}, | ||
|
||
mode: 'production', | ||
|
||
resolve, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: file => ( | ||
/node_modules/.test(file) | ||
&& !/\.vue\.js/.test(file) | ||
), | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
plugins: [ | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-syntax-dynamic-import' | ||
], | ||
presets: [['@babel/preset-env', { modules: false }, '@babel/preset-stage-3']] | ||
} | ||
} | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
{ | ||
loader: 'vue-style-loader' | ||
}, | ||
{ | ||
loader: MiniCSSExtractPlugin.loader | ||
}, | ||
{ | ||
loader: 'css-loader' | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.less$/, | ||
use: [ | ||
{ | ||
loader: 'vue-style-loader' | ||
}, | ||
{ | ||
loader: MiniCSSExtractPlugin.loader | ||
}, | ||
{ | ||
loader: 'css-loader' | ||
}, | ||
{ | ||
loader: 'less-loader' | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.(png|jpg|gif|svg)$/, | ||
loader: 'file-loader', | ||
options: { | ||
name: '[name].[ext]?[hash]' | ||
} | ||
}, | ||
{ | ||
test: /\.(eot|svg|ttf|woff|woff2)$/, | ||
loader: 'file-loader', | ||
options: { | ||
name: '[name].[ext]' | ||
} | ||
} | ||
] | ||
}, | ||
|
||
plugins: [ | ||
new DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: JSON.stringify(env.NODE_ENV) | ||
} | ||
}), | ||
|
||
new VueLoaderPlugin(), | ||
|
||
new OptimizeCssAssetsPlugin(), | ||
new MiniCSSExtractPlugin({ | ||
filename: '[name].css' | ||
}), | ||
|
||
new CompressionPlugin({ | ||
algorithm: 'gzip' | ||
}), | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const path = require('path'); | ||
|
||
const alias = { | ||
vue$: 'vue/dist/vue.common.js', | ||
src: path.resolve(__dirname, '../src/js'), | ||
styles: path.resolve(__dirname, '../src/styles') | ||
}; | ||
|
||
const extensions = ['.js', '.vue', '.json', '.less']; | ||
|
||
module.exports = { | ||
forWebpack: { alias, extensions }, | ||
forEsLint: { | ||
'import/resolver': { | ||
alias: { | ||
map: Object.keys(alias).map(key => [key, alias[key]]), | ||
extensions | ||
} | ||
} | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.