Przeglądaj źródła

try to fix css webpack problem

pull/44/head
Guillaume Vincent 8 lat temu
rodzic
commit
7fe19cb770
17 zmienionych plików z 423 dodań i 223 usunięć
  1. +38
    -0
      app/app.old.vue
  2. +5
    -20
      app/app.vue
  3. +5
    -4
      app/components/features.vue
  4. +49
    -61
      app/components/header.vue
  5. +20
    -11
      app/components/headlines.vue
  6. +29
    -0
      app/components/index.old.vue
  7. +29
    -12
      app/components/password-generator.vue
  8. +15
    -2
      app/locales.js
  9. +9
    -47
      app/main.js
  10. +51
    -0
      app/main.old.js
  11. +43
    -0
      app/router.js
  12. +3
    -4
      app/services/auth.js
  13. +5
    -4
      app/services/logging.js
  14. +1
    -1
      index.html
  15. +13
    -12
      package.json
  16. +22
    -45
      webpack.config.js
  17. +86
    -0
      webpack.config.old.js

+ 38
- 0
app/app.old.vue Wyświetl plik

@@ -0,0 +1,38 @@
<style>
#toast-container > div {
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
filter: alpha(opacity=100);
}

body {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.4;
background: #D3D8E8;
color: #252830;
}

.blue {
color: #0275D8;
}
</style>

<template>
<div>
<lesspass-header></lesspass-header>
<router-view></router-view>
</div>
</template>
<script>
import LesspassHeader from './components/header.vue';

export default {
data: function () {
return {}
},
components: {
LesspassHeader
}
}
</script>

+ 5
- 20
app/app.vue Wyświetl plik

@@ -1,19 +1,10 @@
<style>
@import '../node_modules/bootstrap/dist/css/bootstrap.css';
@import '../node_modules/toastr/build/toastr.min.css';

#toast-container > div {
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
filter: alpha(opacity=100);
}

body {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
color: #cfd2da;
background-color: #252830;
line-height: 1.4;
background: #D3D8E8;
color: #252830;
}

.blue {
@@ -22,19 +13,13 @@
</style>

<template>
<div>
<div id="App">
<lesspass-header></lesspass-header>
<router-view></router-view>
</div>
</template>
<script>
var $ = require('jquery');
window.jQuery = $;
window.Tether = require('tether');
window.$ = $;
var bootstrap = require('bootstrap/dist/js/umd/collapse.js');

import LesspassHeader from './components/header.vue';
var LesspassHeader = require('./components/header.vue');

export default {
data: function () {


+ 5
- 4
app/components/features.vue Wyświetl plik

@@ -1,13 +1,14 @@
<style>
.lesspass-features {
background-color: #0275D8;
color: #D3D8E8;
}

.lesspass-features ul {
line-height: 1.8em;
font-size: 1.15em;
margin: 0px auto;
padding: 0px;
margin: 0 auto;
padding: 0;
list-style-type: none;
}

@@ -23,11 +24,11 @@
}
</style>
<template>
<div class="lesspass-features p-y-3 m-t-2">
<div class="lesspass-features p-y-3">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>{{ $t('features.you_should_use_lesspass') }}</h2>
<h3>{{ $t('features.you_should_use_lesspass') }}</h3>
<ul>
<li>{{{ $t('features.unique_password') }}}&nbsp;;</li>
<li>{{{ $t('features.love_open_source') }}}&nbsp;;</li>


+ 49
- 61
app/components/header.vue Wyświetl plik

@@ -1,85 +1,73 @@
<style>
.header {
background-color: #D8E4EA;
#navbar {
height: 86px;
}

.header {
color: #252830;
}

.navbar {
padding: 1.5rem 0;
}
</style>
<template>
<div class="collapse" id="SignInCollapseNavbar">
<div class="bg-inverse p-a-1">
<div class="container">
<div class="col-lg-12">
<form class="form-inline pull-md-right">
<div class="form-group form">
<div id="header">
<div id="SignInCollapseNavbar" class="bg-inverse collapse">
<div class="container p-t-1">
<form>
<div class="form-group row">
<div class="col-lg-2 col-lg-offset-4 m-b-1">
<label class="sr-only" for="email">{{$t('header.Email')}}</label>
<input type="email" class="form-control form-control-sm" id="email"
placeholder="{{$t('header.Email')}}"
v-model="credentials.email">
</div>
<div class="form-group">
<div class="col-lg-2 m-b-1">
<label class="sr-only" for="password">{{$t('header.Password')}}</label>
<input type="password" class="form-control form-control-sm" id="password"
placeholder="{{$t('header.Password')}}"
v-model="credentials.password">
</div>
<div class="form-group row">
<div class="col-lg-12">
<button type="submit" class="btn btn-primary btn-sm btn-block" @click="signin()">
{{$t('header.Sign_in')}}
</button>
</div>
<div class="col-lg-2 m-b-1">
<button type="submit" class="btn btn-primary btn-sm btn-block" @click="signin()">
{{$t('header.Sign_in')}}
</button>
</div>
<div class="form-group row">
<div class="col-lg-12">
<button type="submit" class="btn btn-primary-outline btn-sm btn-block"
@click="register()">
{{$t('header.Register')}}
</button>
</div>
<div class="col-lg-2 m-b-1">
<button type="submit" class="btn btn-primary-outline btn-sm btn-block"
@click="register()">
{{$t('header.Register')}}
</button>
</div>
</form>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="header">
<nav class="navbar">
<div class="container">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="" href="#">
<img src="../assets/images/logo_text.png" alt="logo">
</a>
</li>
</ul>
<ul class="nav navbar-nav pull-xs-right">
<li class="nav-item" v-if="!user.authenticated">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#SignInCollapseNavbar">
&#9776;
</button>
</li>
<li class="nav-item" v-if="user.authenticated">
<a class="btn btn-primary" @click="logout()">
logout
</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<nav id="navbar" class="navbar">
<div class="container">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="" href="#">
<img src="../assets/images/logo_text.png" alt="logo">
</a>
</li>
</ul>
<!--<ul class="nav navbar-nav pull-xs-right">
<li class="nav-item" v-if="!user.authenticated">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#SignInCollapseNavbar">
&#9776;
</button>
</li>
<li class="nav-item" v-if="user.authenticated">
<a class="btn btn-primary" @click="logout()">
logout
</a>
</li>
</ul>-->
</div>
</nav>
</div>
</div>
</template>
<script>
import auth from '../services/auth'
import {router} from '../main'
var auth = require('../services/auth.js');
var router = require('../router.js');

export default {
data: function () {
@@ -98,7 +86,7 @@
email: this.credentials.email,
password: this.credentials.password
};
auth.login(this, credentials, function(){
auth.login(this, credentials, function () {
$('#SignInCollapseNavbar').collapse('hide');
router.go('/');
});
@@ -111,7 +99,7 @@
auth.register(this, credentials)
},
logout() {
auth.logout(function(){
auth.logout(function () {
router.go('/presentation/');
})
}


+ 20
- 11
app/components/headlines.vue Wyświetl plik

@@ -1,30 +1,39 @@
<style>
.headlines {
color: #252830;
background-color: #D8E4EA;
padding: 5em 0 7em;
}

.headlines .title {
font-size: 1.5rem;
font-size: 1.4rem;
}

.headlines .subtitle {
font-size: 1.3rem;
font-size: 1.2rem;
}

@media (min-width: 550px) {
.headlines {
padding: 1em 0 3em;
}

.headlines .title {
font-size: 2.5rem;
margin-top: 1em;
font-size: 2.3rem;
}
}
</style>
<template>
<section class="headlines text-xs-center">
<section class="headlines">
<div class="container">
<div class="col-lg-10 col-lg-offset-1">
<div class="col-lg-6 hidden-xs-down">
<div v-if="$t('lang') == 'en'">
<img src="../assets/images/story-en.png" class="img-fluid" alt="what is lesspass"/>
</div>
<div v-if="$t('lang') == 'fr'">
<img src="../assets/images/story-fr.png" class="img-fluid" alt="qu'est ce que lesspass"/>
</div>
<small>&copy; Nanou</small>
</div>
<div class="col-lg-6 m-t-3">
<h2 class="title text-primary">{{{ $t('header.title') }}}</h2>
<h4 class="subtitle hidden-xs-down">
<h4 class="subtitle">
<span class="text-primary"> LessPass</span> {{ $t('header.subtitle') }}
</h4>
</div>


+ 29
- 0
app/components/index.old.vue Wyświetl plik

@@ -0,0 +1,29 @@
<template>
<lesspass-headlines></lesspass-headlines>
<password-generator></password-generator>
<lesspass-features></lesspass-features>
<lesspass-faq></lesspass-faq>
<lesspass-footer></lesspass-footer>
</template>


<script>
import LesspassHeadlines from './headlines.vue';
import PasswordGenerator from './password-generator.vue';
import LesspassFeatures from './features.vue';
import LesspassFaq from './faq.vue';
import LesspassFooter from './footer.vue';

export default {
data: function () {
return {}
},
components: {
LesspassHeadlines,
PasswordGenerator,
LesspassFeatures,
LesspassFaq,
LesspassFooter
}
}
</script>

+ 29
- 12
app/components/password-generator.vue Wyświetl plik

@@ -1,6 +1,8 @@
<template>
<div id="password-generator" class="container m-y-3">
<form>
<div id="password-generator" class="container p-y-3">
<div class="row">
<div class="col-lg-12">
<form>
<div class="form-group row">
<div class="col-lg-3 m-t-1">
<label for="pg-email" class="sr-only">
@@ -18,12 +20,17 @@
<label for="pg-masterpassword" class="sr-only">
{{ $t('passwordgenerator.password') }}
</label>
<input id="pg-masterpassword"
class="form-control"
type="password"
placeholder="{{ $t('passwordgenerator.password') }}"
v-model="password"
v-on:blur="updateMasterPassword">
<div class="input-group">
<input id="pg-masterpassword"
class="form-control"
type="password"
placeholder="{{ $t('passwordgenerator.password') }}"
v-model="password"
v-on:blur="updateMasterPassword">
<span class="input-group-btn" @click="changeType('pg-masterpassword')">
<button class="btn btn-secondary" type="button"><i class="fa fa-eye"></i></button>
</span>
</div>
</div>
<div class="col-lg-3 m-t-1">
<label for="pg-site" class="sr-only">
@@ -78,7 +85,8 @@
</div>
<div class="col-lg-3">
<label class="c-input c-checkbox">
<input type="checkbox" id="numbers" value="numbers" v-model="passwordInfo.settings"
<input type="checkbox" id="numbers" value="numbers"
v-model="passwordInfo.settings"
checked>
<span class="c-indicator"></span>
{{ $t('passwordgenerator.numbers_options') }}
@@ -86,7 +94,8 @@
</div>
<div class="col-lg-3">
<label class="c-input c-checkbox">
<input type="checkbox" id="symbols" value="symbols" v-model="passwordInfo.settings"
<input type="checkbox" id="symbols" value="symbols"
v-model="passwordInfo.settings"
checked>
<span class="c-indicator"></span>
{{ $t('passwordgenerator.symbols_options') }}
@@ -125,12 +134,13 @@
</div>
</div>
</form>
</div>
</div>
</div>
</template>

<script>
import Lesspass from '../lesspass'

import Clipboard from 'clipboard';

export default {
@@ -154,9 +164,16 @@
var password = this.password;
if (email && password) {
Lesspass.createMasterPassword(email, password).then(function (masterPassword) {
self.$set('masterPassword', masterPassword)
self.$set('masterPassword', masterPassword);
});
}
},
changeType: function (id) {
if (document.getElementById(id).type == 'password') {
document.getElementById(id).type = 'text'
} else {
document.getElementById(id).type = 'password'
}
}
},
computed: {


app/locales/locales.js → app/locales.js Wyświetl plik

@@ -1,3 +1,6 @@
var I18n = require('vue-i18n');
var Vue = require('vue');

const locales = {
"en": {
"lang": "en",
@@ -84,6 +87,9 @@ const locales = {
"create_account": "Create an account",
"welcome": "Login successful, welcome on LessPass",
"credentials_invalids": "The email address or password you entered is not valid."
},
"register": {
"beta": "Registration for LessPass Entreprise is not yet possible.<br><a href='mailto:contact@oslab.fr?subject=Invitation%20to%20LessPass&body=Hello%0d%0acan%20you%20send%20me%20an%20invitation%20for%20LessPass%20Entreprise%20?%0d%0aThank%20you'><b>Ask your invite here</b></a>"
}
},
"fr": {
@@ -172,10 +178,17 @@ const locales = {
"credentials_invalids": "L' adresse e-mail et/ou mot de passe sont invalides"
},
"register": {
"beta" : "LessPass Application est pour l'instant en version beta. Vous pouvez utilisez LessPass <a href='#password-generator'><b>en mode deconnecté</b></a>"
"beta": "L'inscription à LessPass Entreprise n'est pas encore possible.<br><a href='mailto:contact@oslab.fr?subject=Invitation%20à%20LessPass&body=Bonjour%0d%0apouvez-vous%20me%20faire%20parvenir%20une%20invitation%20pour%20LessPass%20Entreprise%20?%0d%0aMerci'><b>Demandez une invitation</b></a>"
}
}
};


export default locales;
var browserLanguage = (navigator.language || navigator.browserLanguage).split('-')[0];
var lang = browserLanguage in locales ? browserLanguage : 'en';
Vue.use(I18n, {
lang: lang,
locales: locales
});

module.exports = locales;

+ 9
- 47
app/main.js Wyświetl plik

@@ -1,51 +1,13 @@
import Vue from 'vue'
import Router from 'vue-router';
import Resource from 'vue-resource';
import i18n from 'vue-i18n';
require('../node_modules/bootstrap/dist/css/bootstrap.css');
require('../node_modules/font-awesome/css/font-awesome.min.css');
require('../node_modules/bootstrap/dist/js/umd/collapse.js');

import locales from './locales/locales';
import App from './app.vue';
import IndexView from './components/index.vue';
import Dashboard from './components/dashboard.vue';
import auth from './services/auth';
Vue.use(Resource);
Vue.use(Router);
var Vue = require('vue');

Vue.config.debug = true;

var browserLanguage = (navigator.language || navigator.browserLanguage).split('-')[0];
var lang = browserLanguage in locales ? browserLanguage : 'en';
Vue.use(i18n, {
lang: lang,
locales: locales
});
require('./locales.js');
require('./router.js');


Vue.http.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('token');

auth.checkAuth();

export var router = new Router();

router.map({
'/': {
auth: true,
component: Dashboard
},
'/presentation/': {
component: IndexView
}
});

router.redirect({
'*': '/'
});

router.start(App, '#app');

router.beforeEach(function (transition) {
if (transition.to.auth && !auth.user.authenticated) {
transition.redirect('/presentation/')
} else {
transition.next()
}
});
var Resource = require('vue-resource');
Vue.use(Resource);

+ 51
- 0
app/main.old.js Wyświetl plik

@@ -0,0 +1,51 @@
import Vue from 'vue'
import Router from 'vue-router';
import Resource from 'vue-resource';
import i18n from 'vue-i18n';

import locales from './locales/locales';
import App from './app.vue';
import IndexView from './components/index.vue';
import Dashboard from './components/dashboard.vue';
import auth from './services/auth';
Vue.use(Resource);
Vue.use(Router);


var browserLanguage = (navigator.language || navigator.browserLanguage).split('-')[0];
var lang = browserLanguage in locales ? browserLanguage : 'en';
Vue.use(i18n, {
lang: lang,
locales: locales
});


Vue.http.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('token');

auth.checkAuth();

export var router = new Router();

router.map({
'/': {
auth: true,
component: Dashboard
},
'/presentation/': {
component: IndexView
}
});

router.redirect({
'*': '/'
});

router.start(App, '#app');

router.beforeEach(function (transition) {
if (transition.to.auth && !auth.user.authenticated) {
transition.redirect('/presentation/')
} else {
transition.next()
}
});

+ 43
- 0
app/router.js Wyświetl plik

@@ -0,0 +1,43 @@
var Vue = require('vue');
var Router = require('vue-router');

var App = require('./app.vue');
var IndexView = require('./components/index.vue');
var Dashboard = require('./components/dashboard.vue');

Vue.use(Router);

var router = new Router();

router.map({
'/': {
auth: true,
component: Dashboard
},
'/presentation/': {
component: IndexView
}
});

router.redirect({
'*': '/'
});

router.start(App, '#app');

var Auth = require('./services/auth.js');

Auth.checkAuth();

router.beforeEach(function (transition) {
if (transition.to.auth && !Auth.user.authenticated) {
transition.redirect('/presentation/')
} else {
transition.next()
}
});

module.exports = router;




+ 3
- 4
app/services/auth.js Wyświetl plik

@@ -1,7 +1,6 @@
import {router} from '../main'
import logging from './logging'
var logging = require('./logging.js');

export default {
module.exports = {
user: {
authenticated: false
},
@@ -53,4 +52,4 @@ export default {
'Authorization': 'Bearer ' + localStorage.getItem('token')
}
}
}
};

+ 5
- 4
app/services/logging.js Wyświetl plik

@@ -1,4 +1,5 @@
import toastr from 'toastr'
var toastr = require('toastr');
require('toastr/build/toastr.min.css');

toastr.options = {
"closeButton": true,
@@ -10,7 +11,7 @@ toastr.options = {
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"timeOut": "10000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
@@ -18,7 +19,7 @@ toastr.options = {
"hideMethod": "fadeOut"
};

export default {
module.exports = {
error(message){
toastr.error(message);
},
@@ -31,4 +32,4 @@ export default {
clear(){
toastr.clear();
}
}
};

+ 1
- 1
index.html Wyświetl plik

@@ -26,6 +26,6 @@
</head>
<body>
<div id="app"></div>
<script src="dist/app.js"></script>
<script src="dist/bundle.js"></script>
</body>
</html>

+ 13
- 12
package.json Wyświetl plik

@@ -9,7 +9,7 @@
"predev": "npm install",
"dev": "webpack-dev-server --inline --hot --host 0.0.0.0",
"prebuild": "rimraf dist && npm prune && npm install",
"build": "NODE_ENV=production webpack --progress --hide-modules",
"build": "NODE_ENV=production webpack -p",
"start": "NODE_ENV=production node server.js"
},
"repository": {
@@ -28,22 +28,22 @@
"homepage": "https://github.com/guillaumevincent/lesspass#readme",
"dependencies": {
"bootstrap": "^4.0.0-alpha.2",
"clipboard": "^1.5.5",
"clipboard": "^1.5.8",
"express": "^4.13.4",
"font-awesome": "^4.5.0",
"jquery": "^2.2.0",
"tether": "^1.1.1",
"toastr": "^2.1.2",
"vue": "^1.0.15",
"vue-i18n": "^2.3.3",
"vue": "^1.0.16",
"vue-i18n": "^2.4.0",
"vue-resource": "^0.7.0",
"vue-router": "^0.7.10"
},
"devDependencies": {
"babel-core": "^6.4.5",
"babel-loader": "^6.2.1",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-preset-es2015": "^6.3.13",
"babel-core": "^6.5.1",
"babel-loader": "^6.2.2",
"babel-plugin-transform-runtime": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
"babel-runtime": "^5.8.34",
"css-loader": "^0.23.1",
"eslint": "^1.10.3",
@@ -57,16 +57,17 @@
"nodemon": "latest",
"npm-run-all": "latest",
"rimraf": "^2.5.1",
"style-loader": "^0.13.0",
"template-html-loader": "0.0.3",
"uglify-js": "^2.6.1",
"url-loader": "^0.5.7",
"vue-hot-reload-api": "^1.2.2",
"vue-hot-reload-api": "^1.3.2",
"vue-html-loader": "^1.1.0",
"vue-loader": "^8.0.2",
"vue-loader": "^8.1.1",
"vue-style-loader": "^1.0.0",
"vueify": "^8.3.2",
"vueify": "^8.3.5",
"vueify-insert-css": "^1.0.0",
"webpack": "^1.12.12",
"webpack": "^1.12.13",
"webpack-dev-server": "^1.14.1"
},
"babel": {


+ 22
- 45
webpack.config.js Wyświetl plik

@@ -1,61 +1,38 @@
var webpack = require('webpack');

module.exports = {
entry: ['./app/main.js'],
context: __dirname + "/app",
entry: "./main.js",
output: {
path: './dist',
path: __dirname + "/dist",
publicPath: '/dist/',
filename: 'app.js'
},
devServer: {
port: 8080
filename: "bundle.js"
},

module: {
loaders: [
{
test: /\.scss$/,
loaders: ['css', 'sass']
},
//{test: /\.js$/, loader: 'babel-loader', query: {presets: ['es2015']}},

{
test: /\.js$/,
exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//,
loader: 'babel'
},
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.(png|jpe?g|gif)$/,
loader: 'url',
query: {
limit: 10000,
name: '[name].[ext]?[hash]'
}
}
{test: /\.css$/, loader: 'style-loader!css-loader'},
{test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'},
{test: /\.vue$/, loader: 'vue'},
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"}
]
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime']
}
};

if (process.env.NODE_ENV === 'production') {
module.exports.plugins = [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
comments: false
}),
new webpack.optimize.OccurenceOrderPlugin()
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
})
]
} else {
module.exports.devtool = '#source-map'
}
};

+ 86
- 0
webpack.config.old.js Wyświetl plik

@@ -0,0 +1,86 @@
var webpack = require('webpack');

module.exports = {
entry: ['./app/main.js'],
output: {
path: './dist',
publicPath: '/dist/',
filename: 'app.js'
},
devServer: {
port: 8080
},
module: {
loaders: [
{
test: /\.scss$/,
loaders: ['css', 'sass']
},
{
test: /\.js$/,
exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//,
loader: 'babel'
},
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.(png|jpe?g|gif)$/,
loader: 'url',
query: {
limit: 10000,
name: '[name].[ext]?[hash]'
}
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/font-woff"
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/font-woff"
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/octet-stream"
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: "file"
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=image/svg+xml"
}
]
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime']
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
})
]
};

if (process.env.NODE_ENV === 'production') {
module.exports.plugins = [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
comments: false
}),
new webpack.optimize.OccurenceOrderPlugin()
]
}

Ładowanie…
Anuluj
Zapisz